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.
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.