3. Personal Information Class Design a class that holds the following personal data: name, address, age, and phone number. Write appropriate accessor and mutator methods. Also, write a program that creates three instances of the class. One instance should hold your information, and the other two should hold your friends’ or family members’ information. My information: Name: John Doe Address: 111 My Street Age: 22 Phone Number: 555-555-1281 Mom's information: Name: Mom Address: 222 Any Street Age: 52 Phone Number: 555-555-1234 Sis's infomation: Name: Jane Doe Address: 333 Her Street Age: 20 Phone Number: 555-555-4444 Dad's information: Name: Dad Address: 222 Any Street Age: 56 Phone Number: 555-254-5611
3. Personal Information Class Design a class that holds the following personal data: name, address, age, and phone number. Write appropriate accessor and mutator methods. Also, write a program that creates three instances of the class. One instance should hold your information, and the other two should hold your friends’ or family members’ information.
My information:
Name: John Doe
Address: 111 My Street
Age: 22
Phone Number: 555-555-1281
Mom's information:
Name: Mom
Address: 222 Any Street
Age: 52
Phone Number: 555-555-1234
Sis's infomation:
Name: Jane Doe
Address: 333 Her Street
Age: 20
Phone Number: 555-555-4444
Dad's information:
Name: Dad
Address: 222 Any Street
Age: 56
Phone Number: 555-254-5611
Trending now
This is a popular solution!
Step by step
Solved in 2 steps with 1 images