is for loops, and will not do what you think for the switch.
A better way is to enclose the switch in a while loop controlled with a bool:
bool Quit = false;
case 3: //user wants to quit
Quit = true; //execution continues after the while
break; //could use return or exit function here
You also have global variables - which is bad. Put them in main() and send them to whichever function needs them as references.
When doing math with floating point numbers, explicitly specify them as such, so they don't do integer division - like this:
Personally, I always use doubles - if you specify them as 32.0 say they will default to double. The problem with floats is they only have 7 significant figures of accuracy. This is fine for this assignment, but it doesn't take much for it to be a problem.
Lines 28 - 33 could be a ShowMenu function.
line 35 could be combined into line 33.
With your indentation, line up the closing brace with the first character of the statement that initiated it. For example the brace on line 43 should line up with the i on line 38.
Finally, I like to break bad habits early, so try to avoid having
using neamspace std;
. This brings brings the entire STL into the global namespace, polluting it & causing potential for name clashes.
There are a couple things to do. You can put
before each std thing, or you can do this:
I tend to do a mixture, with the above code snippet for things used frequently, and use
for things that are not, such as
Some guys use