rendered paste body#include <iostream.h>
#include <iomanip.h>
#include <ctype.h>
main()
{
//Variables
float uAverage,cAverage,hAverage,uTotal,cTotal,hTotal,salary,uInc,cInc,hInc;
char eduComplete;
while(eduComplete != 'q')
{
cout << "Statistics Canada Average Salary Based on Level of Education" << endl;
cout << "Please Enter Highest Level of Education Obtained => " << endl;
cin >> eduComplete;
switch(eduComplete)
{
case u:
uTotal = uTotal + salary;
uInc++;
break;
case c:
cTotal = cTotal + salary;
cInc++;
break;
case h:
hTotal = hTotal + salary;
hInc++;
break;
case q:
uAverage = uTotal / uInc;
cAverage = cTotal / cInc;
hAverage = hTotal / hInc;
cout << setiosflags(ios::fixed) << setprecision(2) << endl;
cout << endl;
cout << "Average Salary of a University Graduate => " << uAverage << endl;
cout << "Average Salary of a College Graduate => " << cAverage << endl;
cout << "Average Salary of a High School Graduate => " << hAverage << endl;
break;
default:
cout << "Invalid Letter of Education Obtained" << endl;
}
}
return 0;
}