Question: c++ Programing language code Design a class1 Address Attribute private streetNumber; Public: Overloaded constructor set streetNum by a value passed from the user showStreetNum(); Design
c++ Programing language code
Design a class1 Address
Attribute
private streetNumber;
Public:
Overloaded constructor set streetNum by a value passed from the user
showStreetNum();
Design class2 Student
Attributes
(Name, age, and GPA) (public, protected, and private) public: addressPtr POINTER to Address object;
Public: showStudentInfo(): show all students info including the street number
Default constructor set all attribute values with initial values
{addressPtr = new Address; addressPtr->streetNumber = 0;}
Overloaded constructor set all attribute values by a value passed from the user
{addressPtr = new Address; addressPtr->streetNumber = ???;}
Main()
Create a pointer to a Student object (stObjPtr) using the overloaded constructor;
Pass the pointer stObjPtru to a function printAddress(stObjPtru) that will print only the students name and the street number
Use/call the function showStudentInfo() to show the students information.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
