Question: Lab 2 Topic: Constructors You are working to create an application for helping people reach their ideal body weight. Create a data definition class to
Lab
Topic: Constructors
You are working to create an application for helping people reach their ideal body weight. Create
a data definition class to model a person. The person will have a name, current weight, and ideal
weight. When creating a new person, the ideal weight must be specified and set. You need to
define following methods for the person class:
A default constructor
A specific constructor that can create a person object with his name
A specific constructor that can create a person object with his name and current weight
Validating mutators for name, current weight and ideal weight
Accessors for name, current weight and ideal weight
A special purpose method called isInShape. The isInShape method does not accept any
parameters and returns a value to indicate if the person is inshape or not. An inshape
person is someone whose current weight is at or under hisher ideal weight.
Special purpose method for toString method.
Note: A person's ideal weight cannot be more than lbs or less than lbs
Remember you are modeling ONE person only!
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
