I'm having trouble making the switch menu; I want to assign each case to do an specific thing; I labeled everything so you know what I'm talking about.
#include<iostream>
using namespace std;
float getvalue();
float getsum(float &sum, int values[]);
float getaverage(float sum);
float getbiggest(int values[]);
float getlowest(int values[]);
int main()
{
char option;
float V;
V = getvalue();
switch (option)
{
case 1:
//SUM FUNCTION
break;
case 2:
//AVERAGE FUNCTION
break;
case 3:
//BIGGEST NUMBER FUNCTION
break;
case 4:
//LOWEST NUMBER FUNCTION
break;
}
system("pause");
return 0;
}
//GET VALUE
float getvalue()
{
int values[6];
for (int x = 0; x < 6; x++)
{
cout << "Enter Value: ";
cin >> values[x];
}
}
//GET THE SUMM
float getsum(float &sum, int values[])
{
for (int x = 0; x < 6; x++)
{
sum += values[x];
}
return sum;
}
//GET THE AVERAGE NUMBER
float getaverage(float sum)
{
float average;
average = sum / 6;
return average;
}
//GET THE BIGGEST NUMBER
float getbiggest(int values[])
{
float biggest;
for ( int x = 0; x < 6; x++)
{
if (values[x]>biggest)
{
biggest = values[x];
}
}
return biggest;
}
//GET THE LOWEST NUMBER
float getlowest(int values[])
{
float lowest;
for (int x = 0; x < 6; x++)
{
if (values[x] < lowest)
{
lowest = values[x];
}
}