Ok so I am not seeing why my code is not working. The only way I can get the A resposne is if I input 1000 points or higher. If anything less that 1000 total points are put in the program jumps to the else statment unless the exampoints are less than 240, at least that part of the program works. Also I would love to be able to debug this myself but I can not figure out how to do it with jgrasp, i think the issue is because I am using borland 5.5 compiler. Anyways here is the program. Any help would be appriciated.
Code:#include <iostream> using namespace std; const int POSSIBLE = 1000; const int A = 90; const int B = 80; const int C = 70; const int D = 60; const int EXAM = 240; int main() { int exam; int hw; int assignment; int earned; int grade; cout << "How many points did you earn on exams?" << endl; cin >> exam; cout << "How many points did you earn on the MPL homework?" << endl; cin >> hw; cout << "How many points did you earn on the program assignments?" << endl; cin >> assignment; earned = exam + hw + assignment; grade = (earned / POSSIBLE) * 100; if (grade >= A && exam >= EXAM) { cout << "You earned a total of" << " " << earned << " " << "points" << endl; cout << "Congratulations this gives you a letter grade of A!" << endl; } else if (grade >= B && exam >= EXAM) { cout << "You earned a total of" << " " << earned << " " << "points" << endl; cout << "Congratulations this gives you a letter grade of B!" << endl; } else if (grade >= C && exam >= EXAM) { cout << "You earned a total of" << " " << earned << " " << "points" << endl; cout << "Good job this gives you a letter grade of C!" << endl; } else if (grade >= D && exam >= EXAM) { cout << "You earned a total of" << " " << earned << "points" << endl; cout << "Well at least you passed with a letter grade of D!" << endl; } else if (exam < EXAM) { cout << "You earned a total of" << " " << earned << "points" << endl; cout << "You got a grade of F and have failed this class" << endl; cout << "If you did not get at least 240 points on the exams" << endl; cout << "you have failed because to pass the class you must" << endl; cout << "have at least 240 points on exams in order to pass" << endl; } else { cout << "Error you have entered a negative vaule for points earned." << endl; cout << "in this class" << endl; cout << "Please run program again and enter positive value" << endl; cout << "for points earned in the course" << endl; } return 0; }