Question: public class Person { private String name; private int birthyear; private int birthmonth; public Person(){ name = ; } public Person(String nm) { setName(nm); }

public class Person { private String name; private int birthyear; private intpublic class Person { private String name; private int birthyear; private int birthmonth; public Person(){ name = ""; } public Person(String nm) { setName(nm); } public Person(String nm, int yr, int month) { name = ""; setName(nm); setBirthYear(yr); setBirthMonth(month); } public String getName() { return name;} public int getBirthyear() { return birthyear;} public int getBirthmonth() { return birthmonth;} public void setName(String nm) { if (nm.length() >= 0) name = nm; } public void setBirthYear(int yr) { if (yr > 1900 && yr You will write a new class, Student, that inherits from the Person class. (The Person class is available for download - see below.) The Person class store's a person's name, birth year, and birth month. It contains three constructors, the appropriate getters and setters, an equals method and a toString method. The Student class will add one additional attribute, grade point average, which is a double. You will implement the following methods: - no-argument constructor which must ensure that all attributes are initialized and not null. - an overloaded constructor with one String parameter which is the student's name. - an overloaded constructor with a String parameter (student's name), followed by the student's birth year (int), birth month (int), and grade point average (double). - getGPA() which returns the student's grade point average - setGPA(double) - if the parameter is between 0.0 and 4.0 (inclusive), sets the student's grade point average to the value of the parameter; otherwise does nothing. - toString() - which returns a String representation of the student. The format of this string should be: bbb born in month 12 of 2000 GPA =4.0 where bbb is the name of the student who was born in December of 2000 with a 4.0 grade point average - equals(Object o) - returns true if o and the current object are equal; false otherwise. For two students to be equal they must have the same name, birth year and birth month. Their grade point averages must be the same within 0.001 (inclusive). - getGrade() - which returns the school grade the student should be in based on their age. Returns a grade between 1 and 16 (inclusive); otherwise returns - 1. Students may start first grade provided they have turned 6 by the end of the first month of school, which is always August. So in 2023 , students born in August of 2017 or before would be in grade 1. Sample calls for getGrade() and return values: Submit your file, Student.java to codepost.io Gfor testing. Not all test cases will be exposed - so be sure to do some testing on your own. Be sure to include comments at the top with your name and computing ID. Person.java

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!