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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started