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.
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.