I need help with this Java program over a Student class program shown in the image below: The Student class will extend the Person class and contain the following additional information. Student ID // Combination of 10 numbers and uppercase letters (This field will be immutable) University name // Credits enrolled // 19 Qualifies for instate rate // yes or no Late fee assessed // yes or no Food Option Choice //A top plan, B middle plan, C bottom plan, D no plan Health Option Choice // yes or no The Student class will implement getter and setter methods for each field variable. It will also include toString(), compareTo(), and equals() methods. The equals(Student):boolean method will return true if the Student object’s and the argument Student object’s Name and student ID are equal. The compareTo(Student):int - returns -1 when the calling object should precede the argument object, 0 when the calling object and argument objects are considered identical, 1 when the calling object should come after the argument object. The order of precedence is Person, ID.

Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
icon
Related questions
Question

I need help with this Java program over a Student class program shown in the image below:

The Student class will extend the Person class and contain the following additional information.
Student ID // Combination of 10 numbers and uppercase letters (This field will be immutable)
University name //
Credits enrolled // 19
Qualifies for instate rate // yes or no
Late fee assessed // yes or no
Food Option Choice //A top plan, B middle plan, C bottom plan, D no plan
Health Option Choice // yes or no

The Student class will implement getter and setter methods for each field variable. It will also include toString(),
compareTo(), and equals() methods. The equals(Student):boolean method will return true if the Student object’s and
the argument Student object’s Name and student ID are equal. The compareTo(Student):int - returns -1 when the
calling object should precede the argument object, 0 when the calling object and argument objects are considered
identical, 1 when the calling object should come after the argument object. The order of precedence is Person, ID.

 

1 package class Package;
2
3 import java.io.Serializable;
4
5 public class Student extends Person implements Serializable, Comparable<Student> {
60
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
220
23
24
25
26
27
28
29
30
31
32
33
/* the student class will extend the person class and contain the following information:
* (directly from the assignment page)
*
we need:
* variables for
* student id
combo of numbers and letters, of lenght 10
* university name
* credits enrolled
* qualifies for instate rate yes or no
* late fee assessed
yes or no
* food option choice a b c or d
* health option choice yes or no
* we will need to make variables for all of these things in the student class
*/
@Override
public int compareTo (Student pOther) {
int compareValue = ((Person) this) .compareTo ((Person) pOther);
if (compareValue == 0)
{
return 0;
}}
}
return compareValue;
Transcribed Image Text:1 package class Package; 2 3 import java.io.Serializable; 4 5 public class Student extends Person implements Serializable, Comparable<Student> { 60 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 220 23 24 25 26 27 28 29 30 31 32 33 /* the student class will extend the person class and contain the following information: * (directly from the assignment page) * we need: * variables for * student id combo of numbers and letters, of lenght 10 * university name * credits enrolled * qualifies for instate rate yes or no * late fee assessed yes or no * food option choice a b c or d * health option choice yes or no * we will need to make variables for all of these things in the student class */ @Override public int compareTo (Student pOther) { int compareValue = ((Person) this) .compareTo ((Person) pOther); if (compareValue == 0) { return 0; }} } return compareValue;
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 3 steps

Blurred answer
Knowledge Booster
Class
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
Database System Concepts
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education