The marks obtained by a student in 4 different subjects are input by the user. The student gets a division as per the following rules: Percentage above or equal to 95 - Medical Course Percentage between 90 and 95 Engineering course Percentage between 80 and 90 - Hotel Mangement Percentage less than 80 - Arts and Science Write a program to calculate the division obtained by the student. Test Case 1 Input (stdin) 59 79 96 68 Expected Output Arts and Science Test Case 2 Input (stdin) 90 99 98 97 Expected Output Medical Course
#include<iostream>
//#include "Unistam.h"
using namespace std;
int main()
{
int sub1,sub2,sub3,sub4,percentage;
//cout<<"Enter marks of five subjects : ";
cin>>sub1>>sub2>>sub3>>sub4;
percentage=(sub1+sub2+sub3+sub4)/4;
if(percentage>=95)
cout<<"Medical Course";
else if(percentage>=90)
cout<<"Engineering Course";
else if(percentage>=80)
cout<<"Hotel Management";
else
cout<<"Arts and Science" ;
return 0;
}