understanding the problem

Write a program to find the minimum, maximum, and average values of a collection of data values. The number of data values is unspecified.
 
 


help me understand what to do with the problem thanks
Last edited on
Seems pretty straightforward.

1) Get a collection of values (I assume from the user)
2) Once they're done giving your values, find the minimum value, the maximum value, and the average.
3) print those to the screen.
Create a program that asks the user to enter data numbers. You can either dynamically allocate the space needed or use a vector of integers and use the push_back function to add the data member to the vector.

Once the user has inserted the number of elements you could then call a function that you write that takes those values and sorts them from smallest to largest. At that point you will know the smallest value (the first value) and then the largest value(the last value).

You can then write another function that adds all the data members in the vector. This can be done with a simple for loop to iterate through each value in the vector or array and then add the values each iteration and then divide this value the size of the vector or array and return this value.

Hope this help!

Erock
yes finally understood the prob myself declared 3 variables a b c then max and min ave and sum..

do you really need to use nested ifs for the prob cause i dont wanna confuse myself

can it be done only using the And function or Or??

Topic archived. No new replies allowed.