Computer Science, asked by ayesha941, 1 year ago

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 Naresh5551
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();
}
Similar questions