/* This class represents a Person. It stores information regarding the person's first and last name, age and height. */ public class Person { // The first name of the person protected String firstName; // The last name of the person protected String lastName; // The age of the person protected int age; // The height of the person (in feet) protected double height; // Default person constructor initializes a person to be "Joe Schmo", // age 17 and height 5.11. public Person() { firstName = "Joe"; lastName = "Schmo"; age = 17; height = 5.11; } // Person() // Constructor initializes a person with first name. public Person(String vName) { firstName = vName; lastName = "Schmo"; age = 17; height = 5.11; } // Person(String vName) // Constructor initializes a person with input arguments. public Person(String vFirstName, String vLastName, int vAge, double vHeight) { firstName = vFirstName; lastName = vLastName; age = vAge; height = vHeight; } // Person(String vFirstName, String vLastName, int vAge, double vHeight)) // Returns the full name of the person. public String getFullName() { return firstName + " " + lastName; } // getFullName // Returns whether the peron's age is under 18. public boolean isAdult() { return age >= 18; } // isAdult // Called if person has had birthday, increments the age of the person. public void hadBirthday() { age = age + 1; } // hadBirthday // Return a string representation of the person. public String toString() { // Create the resulting string. String result; result = "First Name: " + firstName + "\n"; result = result + "Last Name : " + lastName + "\n"; result = result + "Age : " + age + "\n"; result = result + "Height : " + height + "\n"; // Return the resulting string. return result; } // toString } // Person