Answered step by step
Verified Expert Solution
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 labcpp 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. ie Computer Science would be ComputerScience
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 objects of Student type. Note, this should NOT be an array of Student. Use different Student object declarations. We will cover arrays of objects later.
Student
firstname : string
lastname : string
id : int
gpa : double
major: string
set : void
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started