/* Person.java Author: Kathy Millette Date: Aug 3, 2009 Description: Gather names and ages and print them out in order from oldest to youngest. */ public class Person { // Place the instance variables here. String firstName; String middleInitial; String lastName; int age; // Constructor that loads the names into the new object public Person(String fName, String mInitial, String lName) { firstName = fName; middleInitial = mInitial; lastName = lName; } // Place the getFullName() method here. public String getFullName() { String fullname = lastName + ", " + firstName + " " + middleInitial + "."; return(fullname); } // Place the getters here. There will be four of them. public String getFirstName() { return(firstName); } public String getMiddleInitial() { return(middleInitial); } public String getLastName() { return(lastName); } public int getAge() { return(age); } // Place he setters here. There will be four of them. public void setFirstName(String fName) { firstName = fName; } public void setMiddleInitial(String mInitial) { middleInitial = mInitial; } public void setLastName(String lName) { lastName = lName; } public void setAge(int newage) { age = newage; if ((age < 0) || (age > 110)) { System.out.println("Setting invalid"); age = -1; } } }