Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

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

Step: 3

blur-text-image

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

Professional Android 4 Application Development

Authors: Reto Meier

3rd Edition

1118223853, 9781118223857

More Books

Students also viewed these Programming questions