Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

In C++, Instructions: Design and implement a class called personType according to the specified UML diagram. Write the personType header, personType implementation, and personType client

In C++, image text in transcribed
image text in transcribed
Instructions: Design and implement a class called personType according to the specified UML diagram. Write the personType header, personType implementation, and personType client application in separate files. Remember to include the personType personFirstName: string personLastName: string - personBirthYear: int + personType(string, string, int) +setFirstName(string) + setLastName(string) + setBirthYear(int) +getFirstName) const: string +getLastName) const: string +getBirthYear0 const: int + isAdultO const: bool +printData0 const According to this UML diagram, the class personType will have three PRIVATE member variables: a string called personFirstName, a string called personL.astName and an int called personBirthYear The class will have a parameterized constructor and several PUBLIC member functions the personType constructor will set personFirstName, personLastName, and personBirthYear to the values passed in at instantiation. e . The set FirstName, setL.astName, setBirthYear, getFirstName, getLastName, and getBirth Year functions will either set or return their respective member variable values. The isAdult function will return true if the person is 2 age 18. Else false will be returned Assume the program is only meant to run during 2018, the current year Functions marked const should not be able to modify class member variables. The printData function should output a person's fist name, last name, and birth year. If a person is under the age of 18, a message should be output stating that person is "UNDER 18." Last, write a client application that instantiates an array of 5 personType objects. Use a for loop to load the array of personType objects with values entered by the user. Use a second for loop to printData of the persons who are 2 age 18. Use a third for loop to printData of all users (regardless of age)

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Seven Databases In Seven Weeks A Guide To Modern Databases And The NoSQL Movement

Authors: Luc Perkins, Eric Redmond, Jim Wilson

2nd Edition

1680502530, 978-1680502534

More Books

Students also viewed these Databases questions

Question

7. What are the main provisions of the FMLA?

Answered: 1 week ago

Question

2. Do small companies need to develop a pay plan? Why or why not?

Answered: 1 week ago