create array of students (lastname,firstname)
create array of subjects, grades and compute for the average of Grade per subject.
Determine if it is passed or failed.Compute GPA for each students and count all the passed and failed.
Example:
Enter number of subjects
Enter the name of subjects
Enter the name of students
Enter subjects
Enter grades of (name) for (subject)
name
subject prelim midterm final GPA Remarks
math 90 95 100 95 passed
number of pass:
number of fail:
using namespace std; class Students{ public : string lastname; string firstname; };
class Subjects{ public : string name; int grades; };
int main() { Students students[10]; Subjects subjects[10]; int numberofsubjects; double averageofGradepersubject[10]; int subject=0; cout<<"Enter number of subjects: "; cin>>numberofsubjects; for(int i=0;i<numberofsubjects;i++){ cout<<"Enter the name of subjects: "; cin>>subjects[i].name; } for(int i=0;i<3;i++){ cout<<"Enter the fisrt name of students: "; cin>>students[i].firstname; cout<<"Enter the last name of students: "; cin>>students[i].lastname; cout<<"Enter subjects: "; cin>>subject; cout<<"Enter grades of "<<students[i].firstname<<" for "<<subjects[subject].name; cin>>subjects[subject].grades; } for(int i=0;i<3;i++){ averageofGradepersubject[i]=subjects[i].grades/numberofsubjects; } cout<<" subject prelim midterm final GPA Remarks "; for(int i=0;i<numberofsubjects;i++){ cout<<subjects[i].name<<" "<<subjects[i].grades<<" "<<subjects[i].grades<<" "<<averageofGradepersubject[i]<<"100"; } cout<<" Number of pass: "<<numberofsubjects; cout<<" Number of fail:: "<<numberofsubjects-1;
Numbers and figures are an essential part of our world, necessary for almost everything we do every day. As important…
APPROVED BY CLIENTS
Finding a professional expert in "partial differential equations" in the advanced level is difficult.
You can find this expert in "Assignmentexpert.com" with confidence.
Exceptional experts! I appreciate your help. God bless you!
Comments
Leave a comment