Question: This is a question for my assignment, please respond with the correct code as soon as you can. To be done on Java. Will upvote

This is a question for my assignment, please respond with the correct code as soon as you can. To be done on Java. Will upvote definitely, thanks!

Part A

/** A class representing an instructor. */ public class Instructor extends SchoolPerson { private int salary;

/** Create an instructor with a given name and date of birth and salary. @param name the name @param yearOfBirth the date of birth @param salary the salary */ public Instructor(String name, int yearOfBirth, int sal) { //-----------Start below here. To do: approximate lines of code = 2 // Initialize the inherited variables using super() and initialize // the new variable salary //-----------------End here. Please do not remove this comment. Reminder: no changes outside the todo regions. }

/** Convert instructor to string form. */ public String toString() { //-----------Start below here. To do: approximate lines of code = 1 // override the method toString() and return a string // containing the values of the inherited variables followed by // " Salary: " followed by salary. Hint: make use of super. //-----------------End here. Please do not remove this comment. Reminder: no changes outside the todo regions. } }

Part B

/** A class representing a student. */ public class Student extends SchoolPerson { private String major;

/** Create a student with a given name and date of birth and major. @param name the name @param yearOfBirth the date of birth @param major the major */ public Student(String name, int yearOfBirth, String maj) { //-----------Start below here. To do: approximate lines of code = 2 // Initialize the inherited variables using super() and initialize // the new variable major //-----------------End here. Please do not remove this comment. Reminder: no changes outside the todo regions. }

/** Convert student to string form */ public String toString() { //-----------Start below here. To do: approximate lines of code = 1 // override the method toString() and return a string // containing the values of the inherited variables followed by // " Major: " followed by major. Hint: make use of super. //-----------------End here. Please do not remove this comment. Reminder: no changes outside the todo regions. } }

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!