Help stuck

Can't seem to get this program working, any ideas?

#include <iostream>
#include <iomanip>

using namespace std;

int main()

{
int quiznum,quizsum,program,quizlow;
double testsum,testp,testavg,final;



cout<<"Enter the program average: ";
cin>>program;

cout<<"Enter the sum of the test scores: ";
cin>>testsum;

cout<<"Enter the maximum test points available: ";
cin>>testp;

cout<<"Enter the number of quizzes that have been taken: ";
cin>>quiznum;

cout<<"Enter the sum of all of the quizzes that have been taken: ";
cin>>quizsum;



if (quiznum=<2)
{
testavg=(testsum + quizsum) / (testp + (10 * quiznum)) * 100;
final= (program+testavg)/2;

cout<<" "<<endl;
cout<<" "<<endl;
cout<<"*************************"<<endl;
cout<<" Grade Calculator "<<endl;
cout<<" "<<endl;
cout<<"Program Average "<<program<<endl;
cout<<"Test Average "<<testavg<<endl;
cout<<" "<<endl;
cout<<"Final Grade "<<final<<endl;
cout<<"*************************"<<endl;
}


else

{

cout<<"Enter the sum of the two low quiz scores: ";
cin>>quizlow;

testavg=(testsum + quizsum - quizlow) / (testp + (10 * (quiznum - 2))) * 100;
final= (program+testavg)/2;

cout<<" "<<endl;
cout<<" "<<endl;
cout<<"*************************"<<endl;
cout<<" Grade Calculator "<<endl;
cout<<" "<<endl;
cout<<"Program Average "<<program<<endl;
cout<<"Test Average "<<testavg<<endl;
cout<<" "<<endl;
cout<<"Final Grade "<<final<<endl;
cout<<"*************************"<<endl;

}




return 0;

}





/////// Should look like this

Run 1

Enter the program average: 75.26

Enter the sum of the test scores: 76
Enter the maximum test points available: 100

Enter the number of quizzes that have been taken: 2
Enter the sum of all of the quizzes that have been taken: 17


***************************
Grade Calculator

Program Average 75.26
Test Average 77.50

Final Grade 76.72
***************************
Run 2

Enter the program average: 75.26

Enter the sum of the test scores: 76
Enter the maximum test points available: 100

Enter the number of quizzes that have been taken: 5
Enter the sum of all of the quizzes that have been taken: 42
Enter the sum of the two low quiz scores: 13


***************************
Grade Calculator

Program Average 75.26
Test Average 80.77

Final Grade 78.84
***************************
Last edited on
I think you lack some parenthesis in the lines with
testavg = ...

Please check. :)
thank you!

now im having a problem of

Enter the sum of the test scores:
Enter the maximum test points available:

being put on the same line if "Enter the program average:" i put a number with 1 or 2 decimal places making it come out.

Enter the sum of the test scores:Enter the maximum test points available:

any ideas?




--edited my first post to show my correction--
Last edited on
Please use code tags when posting code, to make it readable:

http://www.cplusplus.com/articles/z13hAqkS/
Topic archived. No new replies allowed.