Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Write a program named lab 4 . cpp that contains a class named Student to store student information. Information that will be relevant to store

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.
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 you'll prompt for information. Note: For entering major, if you need a space, use an underscore. (i.e. Computer Science would be Computer_Science)
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).
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
major: string
+set() : void
image text in transcribed

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

Modern Database Management

Authors: Jeff Hoffer, Ramesh Venkataraman, Heikki Topi

13th Edition Global Edition

1292263350, 978-1292263359

More Books

Students also viewed these Databases questions