Question
struct quiz{ int quizId; int totalMarks; float marksObtained; }; struct course{ int courseId; char * courseName; quiz *totalQuizes; char grade; } ; struct student {
struct quiz{
int quizId;
int totalMarks;
float marksObtained;
};
struct course{
int courseId;
char * courseName;
quiz *totalQuizes;
char grade;
} ;
struct student
{
char*firstName;
char*lastName;
char*rollNumber;
course * coursesRegistered;
int semester;
float gpa;
};
Declare a structure of student. Allocate memory and input firstName, lastName and rollNumber for the student.
Allocate memory for courses registered by that student and input each course 's data for the student. Ask the student that how many courses he has registered in that semester before allocating memory.
For each course allocate memory for three quizzes and add quiz id, total marks and marks obtained for each quiz.
On the basis of marks of quizzes that are input by user, calculate and assign the grade in that course.
On the basis of grade in each course calculate the total gpa of the student in that semester.
Input data for 10 students and then
oFind out all the students in a given CGPA range i-e: (lower range, upper range).
oFind out the students with highest and lowest GPA.
oSearch and display a Students' complete record by his Registration Number.
oDisplay Average of all courses.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started