Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Define a class in C++ whose purpose it is to represent a student of a University and write a simple main() driver program to instantiate

Define a class in C++ whose purpose it is to represent a student of a University and write a simple main() driver program to instantiate several objects of this class, populate each object, and display the information for each object.

the defintion of the student class should be written in an individual header (i.e. student.h) file and the implementation of the methods of the student class should be written in a corresponding source (i.e. student.cpp) file.

The class should be designed around the following characteristics:

The name of the class should be Student.

The class should be composed of the following (data) members:

- student id

- first name

- last name

- middle initial

- date of birth in numeric {month, day, year} form

- gender, one of {Male, Female}

Note that the data type of each member should be appropriate to the type of data being stored.

and at least the following methods:

- Default Constructor

- Constructor to initialize the object with at least the name and date of birth of the student.

- A method to populate the data members from external (user) input.

- Mutator methods for each data member or logical groupings, as necessary. Note that these methods should ensure the integrity of the object and should not allow data to be saved that is not appropriate for that data member. Example, month must be in {1..12}.

- Display method to display the contents of the data members.

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

Bioinformatics Databases And Systems

Authors: Stanley I. Letovsky

1st Edition

1475784058, 978-1475784053

More Books

Students also viewed these Databases questions