Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

IN C++ write a program that will make a class titled Undergraduate that the foll

ID: 3850000 • Letter: I

Question

IN C++ write a program that will make a class titled Undergraduate that the following private member variables: (string) name - A string that stores the name of the undergradate (int) numCourses - An integer that tracks how many courses the undergraduate is currently enrolled in (string*) courseList - A dynamic array of strings used to store the names of the courses that undergraduate is enrolled in (double*) gradeList - A dynamic array of double used to store the grade for each courses that the undergraduate is enrolled in (int) numundergraduates - A static member variable that counts the number of undergraduates created For member functions, you should have Default constructor and argument constructor - public constructors to initialize and create an object from class undergraduate( ) undergraduate(string name, int numCourses) undergraduate(const undergraduate& others) Appropriate and necessary mutators and accessors for private members (what to be defined would depend on specific purpose in your task ) A public function that prints the undergraduates name, all courses in courseList and all grades in gradeList A public function that calculates and print this undergraduates GPA A function that resets the numCourses to 0 and the courseList and gradeList to an empty list A destructor that releases all memory that has been allocated 1.2 file I-O Read file name from command line, e.g., ./projectONE text.txt, to get undergraduate object information. The text.txt format is (contents are just for example) hint : use int main(int argc,char*argv[]) 5 //undergraduate number Amanda t //undergraduate name 4 //course numbers music, art, algebra, history //course list A, B, F, C //grade list johny m 5 art, math, physics, biology, writing A, A-, D+, C-, B Micheal fox 5 French, Math, study hall, biology, java F, C+, C-, D, B+ Anonymous Student 3 science, computer science, wriring C, D+, F tommy 10 A, B, C, D, E, F, G, H, I, J B,C-, A, F, D, A+, B, B-, C+, A steps should follow: • Define a dynamic array of undergraduate objects to store all information from the file operation

Explanation / Answer

# include <iostream.h>
# include <conio.h>
class student
{
private:
int rn;
float fees;
void read()
{
rn=12;
fees=145.10;
}
public:
void show()
{
read();
cout<<" Rollno = "<<rn;
cout<<" Fees = "<<fees;
}
};
void main ( )
{
clrscr ( );
student st;
// st.read ( ); // not accessible
st.show ( );
getch();
}