Click here to Skip to main content
Licence 
First Posted 20 Aug 2004
Views 33,412
Bookmarked 7 times

Ohm's Problem

By | 20 Aug 2004 | Article
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

About the Author

Tom Dziedzic



United States United States

Member



Sign Up to vote   Poor Excellent
Add a reason or comment to your vote: x
Votes of 3 or less require a comment

Comments and Discussions

 
You must Sign In to use this message board. (secure sign-in)
 
Search this forum  
 FAQ
    Noise  Layout  Per page   
  Refresh
GeneralMy vote of 1 Pinmembermattiassundstrom23:53 1 Oct '09  
GeneralWhy not use tryparse Pinmembermorphix2:20 23 Aug '04  
GeneralIsNumeric PinprotectorMarc Clifton11:35 22 Aug '04  
GeneralI have never had a problem with Ohm Pinmemberleppie4:05 22 Aug '04  
GeneralRe: I have never had a problem with Ohm PinsussAnonymous12:22 24 Aug '04  

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.

Permalink | Advertise | Privacy | Mobile
Web01 | 2.5.120517.1 | Last Updated 21 Aug 2004
Article Copyright 2004 by Tom Dziedzic
Everything else Copyright © CodeProject, 1999-2012
Terms of Use
Layout: fixed | fluid