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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started