Question
using C++, Design a class that holds the following personal data: name address age phone number Write appropriate accessor and mutator functions. getName getAddress getAddress
using C++,
Design a class that holds the following personal data:
name
address
age
phone number
Write appropriate accessor and mutator functions.
getName
getAddress
getAddress
getPhone
setName
setAddress
setAge
setPhone
The class should have the following constructors:
A default constructor that assigns empty strings ("") to the name, address, and phone member variables, and 0 to the age member variable.
A constructor that accepts the following values as arguments and assigns them to the appropriate member variables: name, address, age, and phone.
Demonstrate the class by writing a program that creates three instances of it. One instance should hold your information, and the other two should hold your friends' or family members' information. Dsplay them.
Sample Run My information: Name: Joe Doe Address: 15 Main Drive Age: 50 Phone: 408-555-1111 My family meber's information: Name: Jane Doe Address: 123 Bay Street Age: 45 Phone: 408-555-1212 My friend's information: Name: Henry Smith Address: 111 Stelling Road Age: 30 Phone: 408-555-2222
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