1. Create a variable [A]
2. Define variable [A] as an integer
3. Prompt user to enter 5 random real numbers
4. Have variable [A] copy the users first number input
5. If the next number is > [A], then [A] will replace itself with that number
6. Repeat until all numbers are tried
7. Display [A] to the user as the highest number
8. Terminate after 30 seconds
This should work in a definite amount of time given that the user has input real numbers. The only way it wouldn't work would be if the user put in letters or numbers that had decimal places. In an ideal program I would have fail safe messages that warn the user that he is inputing improper numbers. I have very limited programming knowledge up till this point and I am just starting to take C++ this semester. Hope this is good enough.
No comments:
Post a Comment