Find Your GPA in a Semester
Problem:
Write a Program that takes your average obtained mark of a course and then displays your GPA according to the following Grading System. Also mention that whether the student is on probation or not. [Hint: Use if-else structure]
GRADING SYSTEM
AVERAGE MARKS------------ GRADE POINTS
85-100 ------------------------------- 4.00
80-84 ---------------------------------3.70
75-79--------------------------------- 3.30
70-74--------------------------------- 3.00
65-69 ---------------------------------2.70
61-64--------------------------------- 2.30
58-60--------------------------------- 2.00
55-57--------------------------------- 1.70
50-54--------------------------------- 1.00
Below 50 ----------------------------0.00
A student attains Probation Status if his/her CGPA becomes 1.70 or more but less than 2.00.
Solution:
# include <iostream> using namespace std; int main() { double marks; double GPA; cout<<"Enter the Marks"<<endl; cin>>marks; if(marks>=85 && marks<=100){ cout<<"Your GPA is:"<<"4.00"<<endl; GPA=4.00;} else if(marks>=80){ cout<<"Your GPA is:"<<"3.70"<<endl; GPA=3.70;} else if(marks>=75){ cout<<"Your GPA is:"<<"3.30"<<endl; GPA=3.30;} else if(marks>=70){ cout<<"Your GPA is:"<<"3.00"<<endl; GPA=3.00;} else if(marks>=65){ cout<<"Your GPA is:"<<"2.70"<<endl; GPA=2.70;} else if(marks>=61){ cout<<"Your GPA is:"<<"2.30"<<endl; GPA=2.30;} else if(marks>=58){ cout<<"Your GPA is:"<<"2.00"<<endl; GPA=2.00;} else if(marks>=55){ cout<<"Your GPA is:"<<"1.70"<<endl; GPA=1.70;} else if(marks>=50){ cout<<"Your GPA is:"<<"1.00"<<endl; GPA=1.00;} else if(marks<50){ cout<<"Your GPA is:"<<"0.00"<<endl; GPA=0.00;} if(GPA>=1.70 && GPA<=2.00) cout<<"You are on Probation"<<endl; else if (GPA>2.00) cout<<"You are not on Probation"<<endl; return 0; }
Write a Program that takes your average obtained mark of a course and then displays your GPA according to the following Grading System. Also mention that whether the student is on probation or not. [Hint: Use if-else structure]
GRADING SYSTEM
AVERAGE MARKS------------ GRADE POINTS
85-100 ------------------------------- 4.00
80-84 ---------------------------------3.70
75-79--------------------------------- 3.30
70-74--------------------------------- 3.00
65-69 ---------------------------------2.70
61-64--------------------------------- 2.30
58-60--------------------------------- 2.00
55-57--------------------------------- 1.70
50-54--------------------------------- 1.00
Below 50 ----------------------------0.00
A student attains Probation Status if his/her CGPA becomes 1.70 or more but less than 2.00.
Solution:
# include <iostream> using namespace std; int main() { double marks; double GPA; cout<<"Enter the Marks"<<endl; cin>>marks; if(marks>=85 && marks<=100){ cout<<"Your GPA is:"<<"4.00"<<endl; GPA=4.00;} else if(marks>=80){ cout<<"Your GPA is:"<<"3.70"<<endl; GPA=3.70;} else if(marks>=75){ cout<<"Your GPA is:"<<"3.30"<<endl; GPA=3.30;} else if(marks>=70){ cout<<"Your GPA is:"<<"3.00"<<endl; GPA=3.00;} else if(marks>=65){ cout<<"Your GPA is:"<<"2.70"<<endl; GPA=2.70;} else if(marks>=61){ cout<<"Your GPA is:"<<"2.30"<<endl; GPA=2.30;} else if(marks>=58){ cout<<"Your GPA is:"<<"2.00"<<endl; GPA=2.00;} else if(marks>=55){ cout<<"Your GPA is:"<<"1.70"<<endl; GPA=1.70;} else if(marks>=50){ cout<<"Your GPA is:"<<"1.00"<<endl; GPA=1.00;} else if(marks<50){ cout<<"Your GPA is:"<<"0.00"<<endl; GPA=0.00;} if(GPA>=1.70 && GPA<=2.00) cout<<"You are on Probation"<<endl; else if (GPA>2.00) cout<<"You are not on Probation"<<endl; return 0; }