Question: ////////////////C++ if else statement not working////////////// #include using namespace std; int main() { float GPA; // GPA int score; // Test Score while (1) //
////////////////C++ if else statement not working//////////////
#include
int main() { float GPA; // GPA int score; // Test Score
while (1) // infinite loop { cout << "Please enter your GPA: "; // GPA input cin >> GPA;
if (GPA == 0.0) // 0.0 to quit break; cout << "Please enter your entrance score: "; // test score input cin >> score;
if (score = 40 || (score >= 32 && GPA == 3.7)) // score of 40 gets in, high test score and gpa get in { cout << "Congratulations! You are hereby admitted to ABC Medical University!" << endl; } else { cout << "We are sorry! You are hereby denied admission to ABC Medical University." << endl; // rejection statement } } cout << "Thank you for your use of the Admissions Software Program at ABC Medical University" << endl; }
The program determines whether or not you get accepted to this university. It more or less works. The thing is the rejection statement does not print. No matter what score you enter you get accepted.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
