Question: HELP ME PLEASE Instructions The Class Objective: After completion of this lab, you will be able to define and use your own C++ class. Lab

HELP ME PLEASE

Instructions

The Class

Objective:

After completion of this lab, you will be able to

  • define and use your own C++ class.

Lab Exercises

  1. Write a program named lab4.cpp that contains a class named Student to store student information. Information that will be relevant to store is first name, last name, id number, GPA, and major.
    1. Define a member function named set(), which allows you to set all member variables. This function has an empty parameter list, and its return type is void. So, within the function youll prompt for information. Note: For entering major, if you need a space, use an underscore. (i.e. Computer Science would be Computer_Science)
    2. Define a member function named print() that prints a summary of the Student object. You can choose how this data is formatted to the screen (you can use the sample run format).
    3. Create a driver file to test your class. You should instantiate at least 3 objects of Student type. Note, this should NOT be an array of Student. Use 3 different Student object declarations. We will cover arrays of objects later.
Student
- first_name : string - last_name : string - id : int - gpa : double - string : major
+ set() : void + print() : void

Sample Run (User input in bold):

Student Information Database =============================== First Name: Elaine Last Name: Benes ID: 1961 GPA: 4.0 Major: French_Literature First Name: George Last Name: Costanza ID: 1959 GPA: 2.7 Major: Architecture First Name: Cosmo Last Name: Kramer ID: 1949 GPA: 3.5 Major: Business =========Summary=========== Elaine Benes (1961) graduated with a 4.0 GPA in French_Literature. George Costanza (1959) graduated with a 2.7 GPA in Architecture. Cosmo Kramer (1949) graduated with a 3.5 GPA in Business.

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 Databases Questions!