Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

in c++ Write a Course class that has three data members: courseCode, a string, creditHours an integer, and Grade a double. Write a constructor, and

in c++
image text in transcribed
Write a Course class that has three data members: courseCode, a string, creditHours an integer, and Grade a double. Write a constructor, and the appropriate set and get functions needed to set and get the class' data members. Write a class Student that has four data members: studentid, an integer, studentName a string, Num an integer that holds the number of courses the student has finished and a Course pointer Courses Ptr that will be used to dynamically create an array of Course objects that correspond to the courses that the student has finished. Write a constructor that initializes the Student object. Write the appropriate set and get to set and get the student data members. Also make sure that the student class has the following member functions: UpdateGrade function that allows for changing the GPA for one of the courses that the student has finished. AddCourse function that allows the user to add a course that the student has finished to the list of finished courses CalculateGPA member function that calculates and returns the GPA for all the finished course that the student completed. (GPA = the sum of course grade X credit hours devided the number of all completed credit hours) Write a main function that: 1. declares a dynamically allocated array of 5 students, allows the user to set the names, IDs of these students. 2. Adds two finished courses to all 5 students (courseCode:ARA101, ENG101 3 credit hours each, and a grade 100) 3. Prompts the user to enter the ID of a specific student, and then prompts user to enter the number of courses they want to add for that specific student, 4. Prompts the user to enter the course information (code, hours, grade) for the number of courses that they entered in the previous step. After finishing the entry, the program should calculate the GPA for the student that they just added the new information for. GPA should be for all the courses that the student has finished to this point. 5. Prompts the user to enter the ID of another student they want to update the information for, or choose to exit the program. 6. If the user chooses to update one user's information, allow the user to enter the ID of the student they want to update their course grade, then prompts them for the courseCode, then prompts for the new grade value that they want to update

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access with AI-Powered 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

Students also viewed these Databases questions