1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56
|
#include <iostream>
#include <iomanip>
using namespace std;
int total(int a, int b, int c, int d , int e)
{
return a+b+c+d;
}
float average(int a, int b, int c, int d , int e)
{
return total(a, b, c, d, e)/5.0;
}
int smallest(int a, int b, int c, int d , int e)
{
// ???
// return ???;
}
int largest(int a, int b, int c, int d , int e)
{
// ???
// return ???;
}
int main()
{
int
Mild,
Medium,
Sweet,
Hot,
Zesty;
cout << "Enter the number of Mild salsa sold ";
cin >> Mild;
cout << "Enter the number of Medium salsa sold ";
cin >> Medium;
cout << "Enter the number of Sweet salsa sold ";
cin >> Sweet;
cout << "Enter the number of Hot salsa sold ";
cin >> Hot;
cout << "Enter the number of Zesty salsa sold ";
cin >> Zesty;
cout << "Total jars: " << total(Mild, Medium, Sweet, Hot, Zesty) << endl;
cout << "Average jars: " << average(Mild, Medium, Sweet, Hot, Zesty) << endl;
return 0;
}
| |