Computer Science, asked by Vivran1234, 1 year ago

Write a program to accept marks in physics chemistry and biology of a student calculate the average and count how many of them have secured 90% or more in the class having 45 students

Answers

Answered by IPk
2
FOR I=1 TO 45
INPUT"ENTER THE MARKS OF PHY.;CHEM.;BIO.";P,C,B
A=(P+C+B)/3
IF A>=90 AND A<=100
THEN PRINT"SECURED"
ELSE PRINT"NOT SECURED"
ENDIF
END
Answered by cutegirlaastha24
8
#include<iostream.h>
class marks
{
private:
int phy, chem, bio;
float avg , perc;
public:
void input_data()
{
cout<<"Enter marks in physics, chemistry and biology";
cin>>phy>>chem>>bio;
}
void process_data()
{
avg=phy+chem+bio/3;
perc=phy+chem+bio/300*100;
}
void show_data()
{
cout<<"Average Marks is"<<avg;
}
int count()
{
int co=0;
if(perc>=90)
co=co+1;
}
};
void main ()
{
marks ar[45] ;
int h;
for(int i=0,i<45,i++)
{
ar[i].input_data();
ar[i].process_data();
ar[i].show_data();
h=ar[i].count();
}
cout<<"Number of students having 90% or more:"<<h;
}
Similar questions