Question: This small project is geared to get you started on writing Object Oriented program using either Java or C++. Create a class called Person that

This small project is geared to get you started on writing Object Oriented program using either Java or C++.

Create a class called Person that will hold information about a single individual. This class should have a data section that consists of the following:

Variable Name

Data Type

firstName

string

lastName

string

address

string

The Person class should have the following mutators:

  • setFirstName(string first);

  • setLastName(string last);

  • setAddress(string address);

The Person class should have the following accessors:

  • string getFirstName();

  • string getLastName();

  • string getAddress();

The Person class should have the following constructors:

  • Person(); - default

  • Person(string first, string last); - Set other fields to an empty string

  • Person(string first, string last, string address);

Note: You must use delegating constructors to eliminate duplicate code.

Main

Create an array which will hold 5 Person classes. Pass the array to a function called getPeople which will fill out the array with information about people taken from the keyboard. Create a second function called printPeople which will take the array of Person's and print it to the console window. Please format the output so that it can be easily read and understood.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!