Plz paraphrase this code #include using namespace std; struct studmodule { char modulename[30]; int totalmarks; }; struct Student { char name[30]; int age; int studid; struct studmodule module[4]; float avgmarks; }stud[5]; float avg; float classavg; int highmark = 0; int lowmark = 0; float passrate = 0; void inputdata() { int i = 0, tot; cout<<"-------------------------------------------"<>stud[i].name; cout<<"Enter Student "<>stud[i].studid; cout<<"Enter Student "<>stud[i].age; cout<<"-------------------------------------------"<>stud[i].module[j].modulename; cout<<"Enter Student "<>stud[i].module[j].totalmarks; if (stud[i].module[j].totalmarks > highmark) highmark=stud[i].module[j].totalmarks; if (stud[i].module[j].totalmarks < lowmark) lowmark=stud[i].module[j].totalmarks; tot = tot + stud[i].module[j].totalmarks; stud[i].avgmarks = tot / 4; cout<<"-------------------------------------------"<= 40) passrate = stud[i].avgmarks + passrate; passrate = passrate / 4; } } void calculate() { int t = 0; highmark = stud[0].module[0].totalmarks; lowmark = stud[0].module[0].totalmarks; for (int i=0; i<5; i++) { for(int j=0; j<4; j++) { if (highmark < stud[i].module[j].totalmarks) highmark=stud[i].module[j].totalmarks; if (lowmark > stud[i].module[j].totalmarks) lowmark=stud[i].module[j].totalmarks; } t = t + stud[i].avgmarks; } classavg = t / 5; } int overallresult() { cout<<"Overall Result analysis"<
Plz paraphrase this code
#include<iostream>
using namespace std;
struct studmodule
{
char modulename[30];
int totalmarks;
};
struct Student
{
char name[30];
int age;
int studid;
struct studmodule module[4];
float avgmarks;
}stud[5];
float avg;
float classavg;
int highmark = 0;
int lowmark = 0;
float passrate = 0;
void inputdata()
{
int i = 0, tot;
cout<<"-------------------------------------------"<<endl;
cout<<"Welcome to Technology College Muscut"<<endl;
cout<<"-------------------------------------------"<<endl;
cout<<"Students Personnel data Entry"<<endl;
cout<<"-------------------------------------------"<<endl;
for (i=0; i<5; i++)
{
tot = 0;
cout<<"Enter Student "<<i+1 << "Name :";
cin>>stud[i].name;
cout<<"Enter Student "<<i+1 << "Id Number :";
cin>>stud[i].studid;
cout<<"Enter Student "<<i+1 << "Age :";
cin>>stud[i].age;
cout<<"-------------------------------------------"<<endl;
cout<<"Students Academic data Entry"<<endl;
cout<<"-------------------------------------------"<<endl;
for (int j=0; j<4; j++)
{
cout<<"Enter Student "<<i+1 << "Module "<<j+1 <<" Name";
cin>>stud[i].module[j].modulename;
cout<<"Enter Student "<<i+1 << "Total Marks ";
cin>>stud[i].module[j].totalmarks;
if (stud[i].module[j].totalmarks > highmark)
highmark=stud[i].module[j].totalmarks;
if (stud[i].module[j].totalmarks < lowmark)
lowmark=stud[i].module[j].totalmarks;
tot = tot + stud[i].module[j].totalmarks;
stud[i].avgmarks = tot / 4;
cout<<"-------------------------------------------"<<endl;
}
}
}
void outputdata()
{
cout<<"Dispalying Student Information"<<endl;
cout<<"-------------------------------------------"<<endl;
for (int i=0; i<5; i++)
{
cout<<"Student "<<i+1 << "Name :"<<stud[i].name<<endl;
cout<<"Student "<<i+1 << "Id Number :"<<stud[i].studid<<endl;
cout<<"Student "<<i+1 << "Age :"<<stud[i].age<<endl;
cout<<"Student "<<i+1 <<"Modules";
for(int j=0; j<4; j++)
cout<<stud[i].module[j].modulename<<",";
cout<<endl<<"Student "<<i+1 << "Average Marks"<<stud[i].avgmarks<<endl;
cout<<"-------------------------------------------"<<endl;
if (stud[i].avgmarks >= 40)
passrate = stud[i].avgmarks + passrate;
passrate = passrate / 4;
}
}
void calculate()
{
int t = 0;
highmark = stud[0].module[0].totalmarks;
lowmark = stud[0].module[0].totalmarks;
for (int i=0; i<5; i++)
{
for(int j=0; j<4; j++)
{
if (highmark < stud[i].module[j].totalmarks)
highmark=stud[i].module[j].totalmarks;
if (lowmark > stud[i].module[j].totalmarks)
lowmark=stud[i].module[j].totalmarks;
}
t = t + stud[i].avgmarks;
}
classavg = t / 5;
}
int overallresult()
{
cout<<"Overall Result analysis"<<endl;
cout<<"Class Average Marks"<<classavg<<endl;
cout<<"Class Highest Marks"<<highmark<<endl;
cout<<"Class Lowest Marks"<<lowmark<<endl;
cout<<"Class Pass Marks"<<passrate<<endl;
}
int main()
{
inputdata();
outputdata();
calculate();
overallresult();
return 0;
}
Trending now
This is a popular solution!
Step by step
Solved in 2 steps