Question: This is for JAVA programming: Create a class named Puppy. Each Puppy has the following properties: Age-indicates the puppy's age in weeks Sex - either
This is for JAVA programming:


Create a class named Puppy. Each Puppy has the following properties: Age-indicates the puppy's age in weeks Sex - either male or female Price-sales price-shall not be lower than $100 or greater than $500 hasShots-a Boolean either true or false For each of these properties create a getter and setter method. Also create a Puppy method which will display all the values of the Puppy properties. In the setter method ensure that a puppy's age must be between O and 16 weeks. If the age is outside this range set the age to -1. Write a TestPuppy class. This class will create a Puppy object and prompt the user to enter the Puppy's age, sex, Price and hasShots indicator. Do not let the user proceed unless the price is between $100 and $500. Ensure that the only two acceptable entries for sex are "male" or "female". Use a while loop to ensure data entered is within the price and sex data limits. After all the data is entered, Display all the object's property values
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
