Click here to Skip to main content
65,938 articles
CodeProject is changing. Read more.
Articles
(untagged)

Ohm's Problem

0.00/5 (No votes)
20 Aug 2004 1  
This article brings up the old law that no one seems to talk about, or know about. It solves some problems that came up while developing this program.

 

 

 

 

 

 

 

 

Introduction

I have been interested in making electronic components not just for the computer but for the everyday life and self entertainment. I wanted to make all the calculations from ohm's law into a simple program that will enable quick calculations while using the .net framework v.2.0 and in the process using a new language: C#, normally I use C++ but I wanted to switch to the newest technologies out so far. Anyways I have found alot about computer programming like an interesting fact is that the .net framework makes every language the same except the syntax and thats it.

The 'IsNumeric' Problem

I have found out that the .net framework v.2.0 still doesn't have all the features a programmer would like to have like an 'IsNumeric' function, which I used to validate the input. Kind of like the STL for C++, it had all those kinds of goodies like, 'IsAlpha' 'IsAlphanumeric' and my favorite 'IsNumeric' ;-). Anyways I got around this problem by making the following function:

private bool IsNumeric(object value)

{

try

{

UInt32 d = System.UInt32.Parse(value.ToString(),

System.Globalization.NumberStyles.Any);

return true;

}

catch

{

return false;

}

}

This function takes in one parameter of type object and returns true if the parameter is numeric and false if it isn't.

Ohm's Law

I have implemented the whole law in this program which includes basic equations but accurate answers. You can find the eqations in the link provided:  http://www.xteradesign.com/xds/ohms-law.htm

Conclusion

I hope this article helps everyone and I have added a nice GUI to the program, nothing special though, played around with the colors until I was appealed, anyways thanks for the time and don't forget to vote :b.

License

This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

A list of licenses authors might use can be found here