Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

write the student class header so that student is a subclass of person and implements the Comparable interface. 4. Consider the following detailed inheritance hierarchy

write the student class header so that student is a subclass of person and implements the Comparable interface.

image text in transcribed

4. Consider the following detailed inheritance hierarchy diagram Person instance variables private String myFirstName private String myLastName private String myEmailAddress methods public String getFirstName 0) public String getLastName () public String getEmailAddress () Student class variables int lastldAssigned (initially set to 20050) instance voriables private String myStudentld private double myGpa private double myNumberOfCredits methods void addCourse (int credits, double grade) public String getStudentld () public double getGpa () The person constructor has two String parameters: a first name and a last name. the constructor initializes the e-mail address to the first letter of the first name followed by the first five letters of the last name followed by @jc.com. If the last name has fewer than five letters, the e-mail address will be the first letter of the first name followed by the entire last name followed by @jc.com. Examples: Name Jane Smith John Morris Mary Key Email address JSmith@ic.com MKey@ic.com Implement the Person constructor eublic ?e's^ (strin") f.rd Nome. String lastAione )

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

More Books

Students also viewed these Databases questions