Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

C++ Second Graded Assignment: Dynamic Memory Allocation Write a Course class that has three data members: courseCode, a string, creditHours an integer, and Grade a

image text in transcribed
C++
Second Graded Assignment: Dynamic Memory Allocation 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 CoursesPtr 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 Calculate GPA 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 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

Professional IPhone And IPad Database Application Programming

Authors: Patrick Alessi

1st Edition

0470636173, 978-0470636176

More Books

Students also viewed these Databases questions

Question

What are the challenges associated with tunneling in urban areas?

Answered: 1 week ago

Question

What are the main differences between rigid and flexible pavements?

Answered: 1 week ago

Question

What is the purpose of a retaining wall, and how is it designed?

Answered: 1 week ago

Question

How do you determine the load-bearing capacity of a soil?

Answered: 1 week ago

Question

what is Edward Lemieux effect / Anomeric effect ?

Answered: 1 week ago

Question

Assess three steps in the selection process.

Answered: 1 week ago

Question

Identify the steps in job analysis.

Answered: 1 week ago