answer is there
Explanation:
IPUC Computer Science Lab Manual
PROGRAM 10:
Write a C++ program to input the marks of four subjects. Calculate the total percentage and output the result as either "First Class" or "Second Class" or
"Pass
Class" or "Fail" Class
using switch statement. Range (%)
First Class
Between 60% to 100%
Second Class Between 50% to 59%
Pass Class Between 40% to 49% Less than 40%
Fail
#include<iostream.h>
#include<conio.h>
void main()
int ml, m2, m3, m4, total, choice:
float per.
clrscr()
cout<<"Enter the First subject marks?":
cin>>ml:
cout<<"Enter the Second subject marks";
cin>>m2;
cout<<"Enter the Third subject marks":
cin>>m3;
cout<<"Enter the Fourth subject marks";
cin>>m4;
total = ml + m2 + m3+ m4: per = total/4.0;
cout<<"Total Marks = "<<<total<<endl; cout<<"Percentage="<<per<<endl;
choice = (int) per/10: cout<<"The result of the student is: "<<endl;
switch(choice)
case 10:
case 9.
case 8:
case 7:
case 6 cout<<"First Class "<<endl;
break;
case 5: cout<<"Second Class<<endl;
break: case 4: cout<<"Pass Class"<<endl;
break;
default: cout<<"Fail"<<endl;
getch()
Eater the First subject marks:69 Cater the Second subject marku:75:
Enter the Third subject marks 80
OUTPUT 1: Enter the fourth subject marks175
Total Marks 299
Percentage 24.75 The result of the student is
First Class