I have a homework that is all about computing the grade of a student. The formula is multiplying it by 30% then dividing by 100. I'm sure that I typed properly the code but when I run the program the answer is always zero.
int grade, s1,s2,s3,s4;
float average;
cout << "Enter grade in 1st quiz: ";
cin >> s1;
cout << "Enter grade in 2nd quiz: ";
cin >> s2;
cout << "Enter grade in 3rd quiz: ";
cin >> s3;
cout << "Enter grade in 4th quiz: ";
cin >> s4;
s1=(s1*=.30)/100;
s2=(s2*=.30)/100;
s3=(s3*=.20)/100;
s4=(s4*=.20)/100;
average = s1+s2+s3+s4;
cout << "Your average is " << average*100.0 << endl ; //average should not be zero.
I expect the ouput to be 80 to 90 but the actual output is always 0.