A class “Student” has three data members: student_name, enrolment_no, marks of 5 subjects and memberfunction to assign streams on the basis of the criteria given below:Average Marks Stream>90% Computer Science> 80 – 90% Science>75 – 80% Commerce>70 – 75% ArtsBelow 70% VocationalWrite a C++ program to calculate average marks of each student and display student name, enrolmentno, and their stream.
Answers
Answered by
15
#include<iostream.h>
#include<conio.h>
void main()
{
clrscr();
int mark[5], i;
float sum=0;
cout<<"Enter marks obtained in Physics, Chemistry, Maths, CS, English :";
for(i=0; i<5; i++)
{
cin>>mark[i];
sum=sum+mark[i];
}
float avg=sum/5;
float perc;
perc=(sum/500)*100;
cout<<"Average Marks = "<<avg; cout<<"\nPercentage = "<<perc<<"%"; getch();
}
#include<conio.h>
void main()
{
clrscr();
int mark[5], i;
float sum=0;
cout<<"Enter marks obtained in Physics, Chemistry, Maths, CS, English :";
for(i=0; i<5; i++)
{
cin>>mark[i];
sum=sum+mark[i];
}
float avg=sum/5;
float perc;
perc=(sum/500)*100;
cout<<"Average Marks = "<<avg; cout<<"\nPercentage = "<<perc<<"%"; getch();
}
Similar questions
Social Sciences,
7 months ago
Math,
7 months ago
Math,
7 months ago
CBSE BOARD XII,
1 year ago
Chemistry,
1 year ago