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 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90
|
#include <iostream>
using namespace std;
int isitavalidgroup(int x,int y,int z);
int classify(int x,int y,int z);
void rateonescore(int x);
int findtotalscore(int x,int y,int z);
void ratethegroup(int x, int y, int z, int a);
int main()
{
int x, y, z,a;
cout << "What are your SAT scores?" << endl;
cin >> x >> y >> z;
cout << x <<" "<< y <<" "<< z << endl;
a=isitavalidgroup(x,y,z);
if (a == true) {
cout << "valid" << endl;
classify(x,y,z);
}
else
cout << "Invalid" << endl;
}
int isitavalidgroup(int x,int y,int z)
{
if ((x <= 800) && (x >= 200))
x = true;
else
x = false;
if ((y <= 800) && (y >= 200))
y = true;
else
y = false;
if ((z <= 800) && (z >= 200))
z = true;
else
z = false;
cout << endl;
if ((x) && (y) && (z) == true)
return true;
else
return false;
}
int classify(int x,int y,int z)
{
int a;
rateonescore(x);
rateonescore(y);
rateonescore(z);
a=findtotalscore(x,y,z);
cout << a << endl;
ratethegroup(x,y,z,a);
return 0;
}
void rateonescore(int x)
{
if (x<500)
cout << "Less than 500" << endl;
if ((x >= 500) && (x<800))
cout << "500 or above" << endl;
if (x == 800)
cout << "Perfect score" << endl;
}
int findtotalscore(int x,int y,int z)
{
return x + y + z;
}
void ratethegroup(int x, int y, int z, int a)
{
if ( (a >= 2100) && ( (x) && (y) && (z) >= 700) ) {
cout << "outstanding" << endl;
}
if ((a >= 2100) && ((x) && (y) >= 700)&& (z<700)) {
cout << "Very good" << endl;
}
if ((a >= 2100) && ((x >= 700))&&(y<700)&&(z<700)) {
cout << "Lop-sided" << endl;
}
}
|