1) Java storage class called Person. This class is used for a simple study that just tracks a subject's change in weight. So, this Person class keeps track of the person's first name, last name and weight.  So, the class will have the following instance variables: firstName, lastName and weight. Write the mutators for setting the instance variables.  For the first name, set the value to "NOFIRST" if a blank String is passed to the mutator for that variable.  For the last name, set the value to "NOLAST" if a blank String is passed to the mutator for that variable.  For the weight, if the mutator for weight is passed a value less than 20.0, set the value to 20.0 2) Write a constructor that sets a value for all the instance variables by calling the mutator methods 3)  Add a parameterless constructor for this class. 4) Write the accessor methods for the Person class. 5)  Write a toXML() method that will return the following String for a Person named Jane Doe who weighs 125.7 lbs.

Oh no! Our experts couldn't answer your question.

Don't worry! We won't leave you hanging. Plus, we're giving you back one question for the inconvenience.

Submit your question and receive a step-by-step explanation from our experts in as fast as 30 minutes.
You have no more questions left.
Message from our expert:
Our experts need more information to provide you with a solution. Please include required string of toXML() function.Please resubmit your question, making sure it's detailed and complete. We've credited a question to your account.
Your Question:

1) Java storage class called Person. This class is used for a simple study that just tracks a subject's change in weight. So, this Person class keeps track of the person's first name, last name and weight.  So, the class will have the following instance variables: firstName, lastName and weight.

Write the mutators for setting the instance variables.  For the first name, set the value to "NOFIRST" if a blank String is passed to the mutator for that variable.  For the last name, set the value to "NOLAST" if a blank String is passed to the mutator for that variable.  For the weight, if the mutator for weight is passed a value less than 20.0, set the value to 20.0

2) Write a constructor that sets a value for all the instance variables by calling the mutator methods

3)  Add a parameterless constructor for this class.

4) Write the accessor methods for the Person class.

5)  Write a toXML() method that will return the following String for a Person named Jane Doe who weighs 125.7 lbs.

Knowledge Booster
ADT and Class
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
Microsoft Visual C#
Microsoft Visual C#
Computer Science
ISBN:
9781337102100
Author:
Joyce, Farrell.
Publisher:
Cengage Learning,