Createtoddler-a static method that returns


Complete and fully test the class Person that Exercise 10 describes. Include the following methods.

getName-returns the name of the person as a string.

getAge-returns the age of the person.

setName(first,last)-sets the name of the person, given a first an last name as strings.

setName(name)-sets the name of the person, given the entire name as one string.

setAge(age)-sets the age of the person.

createToddler-a static method that returns a special instance of the class to represent a preschooler. The instance has the name "A toddler" ans the age 2

createPreschooler-a static method that returns a special instance of the class to represent an preschooler. The instance has the name "A preschooler" ans the age 5.

creatAdolescent- a static method that returns a special instance of te class to represent an adolescent. The instance has the name "An adolescent" and the age 9.

createTeenager-a static method that returns a special instance of the class to represent a teeager. The instanc has the name "A teenager" and the age 15.

In summary, your program should include a complete class definition, with the required instance variables, constructors, and methods. The class should also include a main method that test the correctness of the program.

Request for Solution File

Ask an Expert for Answer!!
Programming Languages: Createtoddler-a static method that returns
Reference No:- TGS081546

Expected delivery within 24 Hours