Answer to Question #167660 in C++ for sara

Question #167660

Write a program to check if a student is eligible for a master’s program at UD. A person is eligible if their GPA is above 3.0. If a person is an Emirati, the minimum GPA requirement is reduced to 2.5. Write a program that asks that checks for this information. Your program should print “Person is eligible” or “Person is not eligible”. 


1
Expert's answer
2021-03-01T02:04:16-0500
#include<iostream>  
  
using namespace std; 
  
//The start point of the program
int main() 
{ 
	//Declare variable GPA
    float GPA;
	//Declare variable isEmirati
	int isEmirati=0;
	//get a student GPA from the user
    cout<<"Enter a student GPA: "; 
    cin>>GPA;
	if(GPA>=2.5){
		//check if a person is an Emirati, get answer from the user
		while(isEmirati<1 || isEmirati>2){
			cout<<"Is a person an Emirati? (1-yes, 2- no): ";
			cin>>isEmirati;
		}
	}
	//A person is eligible if their GPA is above 3.0.
	if((isEmirati==2 && GPA>=3.0) || (isEmirati==1 && GPA>=2.5)){
		//If a person is an Emirati, the minimum GPA requirement is reduced to 2.5.
		cout<<"Person is eligible\n\n";
	}else{
		// print "Person is eligible" or "Person is not eligible". 
		cout<<"Person is not eligible\n\n";
	}
	//delay
	system("pause");
    return 0; 
} 

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment