Create a program that would compute for the grade equivalent of two students who just took an exam in Math, Science and English. Your program should consist of two structures: first, struct Subjects that has as its members Math, Science and English in which the grade equivalent of the two students is stored; second, struct Student with members Name, Course, and StudentSub whose type is Subjects.
Use a pointer to store the information for the two different students. After entering the name and course of a student, the user must have a choice of which subject she wants to input a grade first. After the user chooses which subject she wants to put a grade, the user should input the student’s score and the total points of the exam. A separate function should compute for the grade of the student given the score and the total points of the exam.
After entering all information the program must display both the student’s name, course and grades in the different subjects.
Ex: Name: Sarah
Course: CS
Math: 2.5
English: 2.5
Science: 2.5
Name: Mark
Course: IT
Math: 2.5
English: 3
Science: 2
To compute for the grade we must compute for the percent correct first.
Percent Correct = (Score / Highest Possible Score)* 100
And what I did was:
#include <iostream> #include <string> using namespace std;
struct Subjects { int math; int science; int english;
Around 68% of developers are now using AI to generate code during development, and some experts are saying that a single developer using AI tools can now do the work of an entire team of 4 to 5 engineers.
According to Figma's State of the Designer 2026 report, 72% of designers now use generative AI in their workflows and 91% say it improves the quality of their work, not just their speed.
But does this mean web developers and designers are becoming less relevant, or are they simply evolving into a different kind of role?
Would love to hear from developers and designers here has AI made your job easier, or do you feel threatened by how fast these tools are improving
It was a huge success for Spotify. Social media exploded over it, haha. Couldn't have asked for more brand attention. But it was also always meant to be temporary; many who were upset seemed to have missed this part.
Question
sweetlife
we have this given problem to work on which is..
Create a program that would compute for the grade equivalent of two students who just took an exam in Math, Science and English. Your program should consist of two structures: first, struct Subjects that has as its members Math, Science and English in which the grade equivalent of the two students is stored; second, struct Student with members Name, Course, and StudentSub whose type is Subjects.
Use a pointer to store the information for the two different students. After entering the name and course of a student, the user must have a choice of which subject she wants to input a grade first. After the user chooses which subject she wants to put a grade, the user should input the student’s score and the total points of the exam. A separate function should compute for the grade of the student given the score and the total points of the exam.
After entering all information the program must display both the student’s name, course and grades in the different subjects.
Ex: Name: Sarah
Course: CS
Math: 2.5
English: 2.5
Science: 2.5
Name: Mark
Course: IT
Math: 2.5
English: 3
Science: 2
To compute for the grade we must compute for the percent correct first.
Percent Correct = (Score / Highest Possible Score)* 100
And what I did was:
#include <iostream>
#include <string>
using namespace std;
struct Subjects
{
int math;
int science;
int english;
};
struct Student
{
string name;
string course;
string StudentSub;
};
int percent(int a, int b)
{
int r;
r=(a/b)*100;
return r;
}
void main()
{
int c;
int score,total;
char choice;
Student astud;
Student *pstud;
pstud = &astud;
cout<<"Name :";
getline(cin,pstud->name);
cout<<"Course :";
getline(cin,pstud->course);
cout<<"Choose a subject:"<<endl;
cout<<"1.Math"<<endl;
cout<<"2.Science"<<endl;
cout<<"3.English"<<endl;
cin>>choice;
switch(choice)
{
case '1' :
cout<<"Math"<<endl;
cout<<"Score: ";
cin>>score;
cout<<"Total Score: ";
cin>>total;
c = percent(score,total);
cout<<"Grade: "<<c<<endl;
break;
case '2':
cout<<"Science:"<<endl;
cout<<"Score: ";
cin>>score;
cout<<"Total Score: ";
cin>>total;
break;
case '3':
cout<<"English:"<<endl;
cout<<"Score: ";
cin>>score;
cout<<"Total Score: ";
cin>>total;
break;
default:
cout<<"Try again"<<endl;
}
}
I got stuck. Specially with the calling of the functions. Can I please get some help? Thank you.
Link to comment
https://www.neowin.net/forum/topic/1267580-i-need-help/Share on other sites
2 answers to this question
Recommended Posts