Been playing around with it, I got the errors to go away but my if else statements aren't working correctly. no matter what the final score is, it goes with the first output. for example, if the score is 200..it outputs: "
"Your total score is 200 and you have a B"
The best possible grade you can get is an A
You need 250 points to do so.
This is incorrect because the output should give the user a F and say he has failed...
#include <iostream>
#include <cmath>
#include<iomanip>
using namespace std;
if(score >= 450){
cout << "You are exempt from the Final Exam" << endl;
}
else {
cout<< "You are not exempt" << endl;
cout<< "Enter your projected grade for Homework 7(Range from (0-30): " << endl;
cin >> Sean.hw7;
score += Sean.hw7;
}
if(score >= 450){
cout << "You are exempt from the Final Exam" << endl;
}
else if (score >= 400 ||score < 450){
cout << "Your total score is " << score << " and you have a B " << endl;
cout << "You are still not exempt " << endl;
cout << "The best possible grade you can get by taking the final is an A " << endl;
cout << "You need " << 450 - score << " more points to do so" << endl;
}
else if (score >= 350 || score < 400){
cout << "Your total score is " << score << " and you have a C " << endl;
cout << "You are still not exempt " << endl;
cout << "The best possible grade you can get by take the final is an A " << endl;
cout << "You need " << 450 - score << " more points to do so." << endl;
}
else if (score >= 300 || score < 350){
cout << "Your total score is " << score << " and you have a D " << endl;
cout << "You are still not exempt " << endl;
cout << "The best possible grade you can get by take the final is a B " << endl;
cout << "You need " << 400 - score << " more points to do so." << endl;
}
else if (score >= 250 || score < 300){
cout << "Your total score is " << score << " and you have a F " << endl;
cout << "You are still not exempt " << endl;
cout << "The best possible grade you can get by take the final is a C " << endl;
cout << "You need " << 350 - score << " more points to do so." << endl;
}
else{
cout << "Your total score is " << score << " and you have a F " << endl;
cout << "You have failed the course.";
}
std::cout << "Press ENTER to continue...";
std::cin.ignore( std::numeric_limits<std::streamsize>::max(), '\n' );
return 0;
}
There's nothing to debug, Im not getting errors. Its just not going to my if else if the first statement isn't true. And I would use them if I knew what it does
Have you tried putting parentheses around that massive string of additions?
I'm not really sure where you're saying the error is occurring at, but I would start there.
EDIT:
Your list of if statements, I believe you were wanting the and operator (&&) and not the or operator (||) for all those conditions.
@ResidentBiscuit THANKS!!! I went wrong by putting the OR operator and I mean the And..just haven't used them in so long and got mixed up. I really appreciate it