// problem 4.cpp : Defines the entry point for the console application.
//
#include<iostream>
#include<string>
#include<math.h>
usingnamespace std;
int main(){
int quizOne,quizTwo,Mid,Final,quizEnd,midEnd,finalEnd,endGrade; //declares ints
cout<<"Enter quiz one:"<<endl; //enter quizOne
cin>>quizOne;
cout<<"Enter quiz two:"<<endl;
cin>>quizTwo; //enterquizTwo
cout<<"Enter midterm"<<endl;
cin>>Mid; //enter mid
cout<<"Enter Final"<<endl;
cin>>Final; //enter final
quizEnd=(quizOne+quizTwo)*.25; //add 2 quizes, multiply so it equals .25 out o total grade
midEnd=Mid*.25; //multiply so it equals .25 out of total grade
finalEnd=Final*.5; //multiply so it equals .5 of total grade
endGrade=finalEnd+midEnd+quizEnd/((20*.25)+(50*.25)+(50*.5)); //algorithm to add percentages
cout<<quizOne<<"/10"<<endl;
cout<<quizTwo<<"/10"<<endl; //redisplay grades
cout<<Mid<<"/50"<<endl;
cout<<Final<<"/50"<<endl;
if(endGrade>=/9) //if greater than .9 display A
{ cout<<"A";
}
if(endGrade>=.8,endGrade<.9) //if greater or equal to .8 but less than .9 display b
{ cout<<"B";
}
if(endGrade>=.7,endGrade<.8) //if greater or equal to .7 but less than .8 display c
{ cout<<"C";
}
if(endGrade>=.6,endGrade<.7) //if greater or equal to .6 but less than .7 display d
{ cout<<"D";
}
if(endGrade<.6) //if less than .6 display f
{ cout<<"F";
}
return 0;
}
// Find the average grade, then get 25% of that
quizEnd=((quizOne+quizTwo)/2.0)*.25;
// You got these two right
midEnd=Mid*.25;
finalEnd=Final*.5;
// And you did this WAY wrong
// You are going to simply add the percents together
endGrade=finalEnd+midEnd+quizEnd;
Here is my code that I got while working on your program
I figured out why it is showing all of the other grades, because it matches the parameters of the other grades aswell, but i just want to show the 1 grade that applies to the score
Where 'something' is what you already have written. You could (and will have to where else if is not suitable) do the list correctly in the first place though: