In: Computer Science
A student is eligible to apply for graduation in a semester if the student has completed 120 or more credits and currently registered in the senior project class. Your job is to write a C++ program to determine whether a student can apply for graduation or not.
The program should ask questions to the user on the screen and
determine and output "Yes, you can apply for graduation" or "No,
you cannot apply for graduation yet". Make sure to test your
program for both graduating and not graduating student
data.
#include<iostream>
using namespace std;
int main()
{
int credit;
char p;
cout<<"\nEnter total number of credits :";
cin>>credit;
cout<<"\nAre you in senior project class(y/n) :";
cin>>p;
if((credit>=120)&&(p=='y'))
cout<<"\nYou can apply for graduation";
else
cout<<"\nYou cannot apply for graduation";
}
If you have any questions comment down. Please don't simply downvote and leave. If you are satisfied with answer, please? upvote thanks