Answer:
Step-by-step explanation:
C++ Code
#include<iostream> //for input and output
using namespace std;
int main()
{
int credit = 10;
if(credit<30){
cout<<"frehsman";
}
else if(credit>=30 && credit<60){
cout<<"sophomore";
} else if(credit>=60 && credit<90){
cout<<"junior";
} else if(credit>=90){
cout<<"senior";
}
return 0;
}
Code Explanation
First declare credits variable and assign the desired value to it. then check credits value by using else if in which by applying its condition, print the appropriate expression.
Output
Case 29:
freshman
Case 59:
sophomore