CodeHS java 9.5.7
//CodeHS AP Computer Science A Java, 9.5.7: Creating .equals
//DO NOT COPY AND PASTE, YOUR TEACHER CAN SEE YOUR EDIT HISTORY.
//Part 1/2
//PersonTester.java
import java.util.Scanner;
public class PersonTester
{
public static void main(String[] args)
{
Scanner scanner = new Scanner(System.in);
System.out.print("Please enter the Person's name: ");
String tempName = scanner.nextLine();
System.out.print("Please enter the Person's birthday: ");
String tempBirthday = scanner.nextLine();
Person person = new Person(tempName, tempBirthday);
tempName = "";
tempBirthday = "";
System.out.print("Please enter the Student's name: ");
tempName = scanner.nextLine();
System.out.print("Please enter the Student's birthday: ");
tempBirthday = scanner.nextLine();
System.out.print("Please enter the Student's grade: ");
int tempGrade = scanner.nextInt();
Person student = new Student(tempName, tempBirthday, tempGrade);
System.out.println(person.equals(student));
}
}