Personal Information ProgramDevelop a program, in which you’ll design a class that holds the following personal data: name, address, age, and phone number. As part of the program, you’ll then create appropriate accessor and mutator methods. Also, set up three instances of the class. One instance should hold your information, and the other two should hold your friends’ or family members’ information.Input: data for the following attributes of 3 instances of the Personal Information Class: name, address, age, and phone number NOTE: The input data do not need to be real data; they need to be entered at the keyboard, when program is run.Processing: Develop the following: Personal Information Class A program that creates three instances of the above class Output:Set up a loop and display data within each object: name, address, age, and phone number
OOPs
In today's technology-driven world, computer programming skills are in high demand. The object-oriented programming (OOP) approach is very much useful while designing and maintaining software programs. Object-oriented programming (OOP) is a basic programming paradigm that almost every developer has used at some stage in their career.
Constructor
The easiest way to think of a constructor in object-oriented programming (OOP) languages is:
Personal Information
- data for the following attributes of 3 instances of the Personal Information Class:
- name, address, age, and phone number
NOTE: The input data do not need to be real data; they need to be entered at the keyboard, when program is run.Processing: Develop the following:
- Personal Information Class
- A program that creates three instances of the above class
Output:Set up a loop and display data within each object:
- name, address, age, and phone number
Trending now
This is a popular solution!
Step by step
Solved in 2 steps with 2 images