I'm making a program which outputs the min, max and average for any specified user input of numbers, for example a sample output would be:
Enter a choice (0 for max, 1 for min, 2 for avg, 3 to quit): 1
How many numbers?: n numbers
Enter n numbers: 1 , 2, 3 ,4..etc
Min is : __
my flowchart is logical as of right now, but i cannot figure out how to correspond how many numbers? a user chooses to enter to then entering that amount of numbers.
I was thinking something like this for coding (just some of the body):
int main() {
int count = 0;
int choice;
int nums;
etc...
cout << "Enter a choice: "
cin >> choice;
while (cin)
count = count + 1
cout << "How many numbers?: ";
cin >> count;
cout << "Enter " << count << "numbers:";
cin >> nums;
I know this isnt correct, but i cannot figure out the logic on how to set a user specified amount of numbers.
Ex- How many numbers: 7
Enter 7 numbers: