Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Assume that we want to track students information of a specific major. Each student takes the same 20 mandatory courses during his/her study. Also, each

Assume that we want to track students information of a specific major. Each student takes the same 20 mandatory courses during his/her study. Also, each student has an ID and a name. Write a C++ Student class to represent a Student as the following :

  1. Define member variables to represent the id of type integer, name of type string, and grades as an array of integers of size 20. (5 points)
  2. A default constructor that initializes the student id to 0, name to , and the grades to 0. (5 points)
  3. An initializer constructor that receives values for id and name. (5 points)
  4. Define a setter and getter for name. (5 points)
  5. Define a setter for grades which receives an array of integers that represent the grades of courses for the students. Assume the size of the received array is 20. Note that grades take value between 0 and 100. (6 points)
  6. float GetGPA() member function that returns the GPA of the student. This represents the average of students grades. (6 points)
  7. bool HasHigherGPA(Student & stdObj) which returns true if the current student has higher GPA than the received student stdObj. (6 points)
  8. int CompareCourseByCourse(Student & stdObj) member function that returns the number of courses that current student scored higher than received student stdObj. (7 points)

    Write a main function that uses the Student class done in the previous question. Assume that you have implemented the Student class correctly with all functions given. Also, assume that you have setters and getters for id, name, and grades member variable. In the main function, do the following:

  9. Define two Student objects s1 and s2 where s1 uses the default constructor and s2 uses the initializer constructor. Initialize s2 with 1000 for the id and Salem for the name. (7 points)
  10. Define an array of integers of size 20, read 20 grades from user input, and assign the read grades to student s2. (7 points)
  11. Define an array of 100 student objects and call it PSUTStudents. Read the ids, names, and grades of each student from user input. (7 points)
  12. Print the names of the students who have their GPAs above the average of the 100 students. (7 points)
  13. Print the name of the student who scored the highest in all courses (Course by Course comparison). Note that this student might not be the one of highest GPA. (7 points)

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Harness The Power Of Big Data The IBM Big Data Platform

Authors: Paul Zikopoulos, David Corrigan James Giles Thomas Deutsch Krishnan Parasuraman Dirk DeRoos Paul Zikopoulos

1st Edition

0071808183, 9780071808187

More Books

Students also viewed these Databases questions

Question

How would you know a good solution if you saw it?

Answered: 1 week ago

Question

Is there anything out of bounds?

Answered: 1 week ago

Question

What are the cost limitations?

Answered: 1 week ago