Question: In C + + : Write a class named Student that has the following PRIVATE member variables using Student _ h and Student.cpp: name -

In C++:
Write a class named Student that has the following PRIVATE member variables using Student_h and Student.cpp:
name - a string that hold the student's name
idNumber - an integer that holds the student's ID number
major - a string that holds the student's major
The class should have the following member functions (most of these, if not all, will be public accessor or mutator functions):
A constructor that accepts the following values as arguments and assigns them to the appropriate member variables: student name, ID number, and major.
A constructor that accepts the following values as arguments and assigns them to the appropriate member variables: student name and ID number. The major should be assigned an empty string ("").
A default constructor that assigns empty strings ("") to the name and major member variables and 0 to the ID number member variable.
A function to update the student name.
A function to update the id number.
This function should verify that the id number is greater than zero.
A function to update the major.
A function to retrieve the student name.
A function to retrieve the id number.
A function to retrieve the major.
Write a program that demonstrates that your Student class works by creating three Student objects, one for each of the three constructors you create in the class definition. You must also show that the update functions created work by updating the Student object you created using the default constructor.
Once all three Student objects have been created, display (In table format) each object's three private member attributes by calling the public accessor functions for each object.
When you are satisfied that your project is working correctly (and provides accurate results), upload the source code and any header file(s)(the .cpp file) to this submission link. You get only one chance to upload the correct file(s) for each assignment so make sure you are uploading the correct file each time.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!