Help me with my C++ code

a program that would ask the user to enter positive float values from the keyboard when promted by the program. to signal end of input the user enter a negative integer. When data entry has terminated, the program should output the following:
a)minimum value entered
b)maximum value entered
c)average of the positive values entered
if there is no data entry, (the user enters a negative number initially)then the program should output a message indicating that no data has been entered.
We'll happily help you after you post some code that indicates that you've tried to solve this problem yourself. That aside, we don't really solve homework problems for people here. :/

A hint, though, if you haven't started yet:
Consider using an std::vector to store your values.
http://www.cplusplus.com/reference/stl/vector/

If you're not extremely concerned about performance, you can sort your vector to be able to quickly get the maximum and minimum values (quickly as in a few lines of code).
http://www.cplusplus.com/reference/algorithm/sort/

Have fun!

-Albatross
Last edited on
Topic archived. No new replies allowed.