Once again I come to you with a completed homework assignment. However, even though this is completed, I would like to know the ways in which the program fails, and how to fix those errors. I do hope someone can help me. The program is designed to compute the charges per customer for AVISTA Utilities (which is a little weird since I use their services for my home). In any case, the program takes input from the user and spits out and answer. Thanks in advance for taking a look.
The following code shows two different results using the same variables.
If the code is contiguous and not broken up a completely different result occurs.
Unless this is what Flyn380 wants, I dont know, but it is something Ive always had problems with.
I will try and change the code to something more like what has been suggested. I found out today that I am not supposed to be prompting the user for the entries for each of the variables listed. Instead a data file like "data.txt" will be used on the program in order to produce results. I spent a bunch of time on the code today in the lab and found multiple errors in the math (where I totally missed the mathematical prededence.. duh) as well as an endless loop from one of the functions. The other thing that I need to do is verify the input values given. I asked about using the cin.fail() and was told that while that would work it won't work in every case. The problem is, I have no idea how to do that. I will post the code here shortly for folks to look and and possibly give me a shove in the right direction. For now though I have a little bit more clean up to do before I post the code. Thanks again for everyone's help.
Also, I know there is probably a lot of extra stuff that is an eyesore for more experienced coders. I hope you can bear with me as I learn this stuff. I am sure that the code will become much cleaner as I progress.