So I am trying to write a program that will tell you the lowest grade and the highest grade out of the 3 wthat you put in and also tell you the current average you have in the class. I got the lowest and highest part taken care of but I am having issues with it coming up with the current average you have in the class. It keeps giving me 0 as the average for the student and I can't find the mistake so I was hoping another set of eyes can help me out with this. Here is the program:
`#include <iostream>
using namespace std;
int main()
int midtermgrade, projectaverage, papergrade;
cout << "Please enter your midterm grade" << endl;
cin >> midtermgrade;
cout << "Please enter your project average" << endl;
cin >> projectaverage;
cout << "Please enter your paper grade" << endl;
cin >> papergrade;
if ((midtermgrade > projectaverage) && (midtermgrade > papergrade))
{
cout<<"You highest grade is " <<midtermgrade << endl;
}
else if ((projectaverage > midtermgrade) && (projectaverage > papergrade))
{
cout<<"Your highest grade is " <<projectaverage << endl;
}
else if ((papergrade > projectaverage) && (papergrade > midtermgrade))
{
cout<<"Your highest grade is " <<papergrade << endl;
}
if ((midtermgrade < projectaverage) && (midtermgrade < papergrade))
{
cout<<"You lowest grade is " <<midtermgrade << endl;
}
else if ((projectaverage < midtermgrade) && (projectaverage < papergrade))
{
cout<<"Your lowest grade is " <<projectaverage << endl;
}
else if ((papergrade < projectaverage) && (papergrade < midtermgrade))
{
cout<<"Your lowest grade is " <<papergrade << endl;
}
int paperweight, projectweight, midtermweight, currentaverage;
paperweight=.25;
projectweight=.3;
midtermweight=.2;
currentaverage = ((paperweight * papergrade) + (projectweight * projectaverage) + (midtermweight * midtermgrade));
cout << "You current average is " <<currentaverage << endl; // trying to find the average but it keeps coming out as 0
return 0;
Hope someone can find my error and I am new to the C++ so any kind of feedback or advice is welcome.