Question: Problem 5 Header files: 20 + 10 +10 pts (Exercise 4.5, problem 13 from textbook) Please define a class Person.h for name (string), birth year

Problem 5 Header files: 20 + 10 +10 pts

(Exercise 4.5, problem 13 from textbook) Please define a class Person.h for name (string), birth year (int), gender (string), SSN (string), height (int, assuming the unit is inch), weight (int, assume the unit is kilogram), hair color (string), eye color (string) and maritalStatus (char, "M' or 'S'). In this class, we need to have a constructor that takes all the above parameters when instantiate an instance. If no parameter, the default will set all those string type to a white space, and the int types will be set to 0 and maritalStatus will be 'S'.

Inside this class we have three types of functions. Type 1: 9 set functions to set values for those 9 elements. Type 2: Age function that calculates the age of a of a person. Type 3: Into Pound function that converts kilogram into pounds. person.

Write a Person.cpp Implement those functions in the Person.cpp

Write a Person Test.cpp to demonstrate that your implementation works. In your testing, you test to use use pointer one a person object and one of the test has to be a concrete instance of a person.

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 Programming Questions!