Need assistance with a menu program

I have a problem in c++ where I must be able to enter a maximum of 100 values. I must be able to cancel the input whenever I want. And when the input is finished a menu will show up. I'll be using vectors and loops.

How do I:
1. calculate the highest value?
2. How do I calculate the lowest value?
3. How do I calculate the mean?
4. How do I list all of the numbers in one column with one decimal right under each other.

#include <iostream>
#include <iomanip>
#include <stdlib.h>
using namespace std;
void main()
{
const int value=100;
double middle, highest, lowest, sum = 0;
double counter[value + 1];
int i, val;


for (i=1; i<=value; i++)


{
cout << "Enter some values: ";
while (cin >> value)
cin >> counter[i];
sum+= counter[i];
}

middle = sum / value;




system("cls");
cout << "1. highest" << endl;
cout << "2. lowest" << endl;
cout << "3. middle" << endl;
cout << "4. Lista" << endl;
cout << "5. end" << endl;
cout << endl << "Välj: ";
cin >> option;
{
switch(option)

case 1:

break;

case 2:

break;

case 3:

break;

case 4:

break;

case 5:

break;

}

Have I done anything wrong so far?

-------------------

Any help appreciated! :)
Yes, you have.

Why not compile the above program, run it, and see what it does? (Does it do what you expect it to do?)

Hint: the body of your for() loop is wrong.
Topic archived. No new replies allowed.