The fastest way to do this, is to:
1) Get your basic FLOW and calculations of the program, working correctly. At first, just display it on the screen - it's faster, and so easy to go back AFTER you have the basics right, and change the printf() statements, to fprintf(), and just add the file pointer.
2) Check your equation out on Google - I'm sure a basic equation like that is all over. Whatever numbers you get at first, check it and make sure it's right, before you do much else.
3) Post up your skeleton program, minus the final details, if you get stuck and need some help. Check each function as you code it, for syntax and other errors, before going to the next function.
Once you get the basics working, the details just fall into place nicely.
Reputation Points: 416
Solved Threads: 181
Nearly a Posting Virtuoso
Offline 1,463 posts
since Jun 2008