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. Please can you write it in C++ coding form because I never took Java. Can you help me solve this problem in C++ forms using the Classes / Constructors method like: main.cpp Person.h Person.cpp PLease write the coding in c++ forms. As well using the comment method because I can fuse how to due this comment method

EBK JAVA PROGRAMMING
9th Edition
ISBN:9781337671385
Author:FARRELL
Publisher:FARRELL
Chapter4: More Object Concepts
Section: Chapter Questions
Problem 11PE
icon
Related questions
Question
100%

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.

Please can you write it in C++ coding form because I never took Java.

Can you help me solve this problem in C++ forms using the Classes / Constructors method like:

main.cpp

Person.h

Person.cpp

PLease write the coding in c++ forms.

As well using the comment method because I can fuse how to due this comment method

Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 2 steps with 1 images

Blurred answer
Knowledge Booster
Class
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
EBK JAVA PROGRAMMING
EBK JAVA PROGRAMMING
Computer Science
ISBN:
9781337671385
Author:
FARRELL
Publisher:
CENGAGE LEARNING - CONSIGNMENT
Microsoft Visual C#
Microsoft Visual C#
Computer Science
ISBN:
9781337102100
Author:
Joyce, Farrell.
Publisher:
Cengage Learning,
Programming Logic & Design Comprehensive
Programming Logic & Design Comprehensive
Computer Science
ISBN:
9781337669405
Author:
FARRELL
Publisher:
Cengage