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 2
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 in-shape or not. An in-shape
person is someone whose current weight is at or under his/her ideal weight.
Special purpose method for toString method.
Note: A person's ideal weight cannot be more than 200.0 lbs or less than 120.0 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 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 Databases Questions!