Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

otic class newStudent { no usages public static void main(String[] args) & Student s1= new Student(); s1. setYearofschool( sophonore); Systen.out.printf(student Xs Xs Lives at Xs

image text in transcribed
image text in transcribed
image text in transcribed
image text in transcribed
image text in transcribed
image text in transcribed
image text in transcribed
image text in transcribed
image text in transcribed
otic class newStudent \{ no usages public static void main(String[] args) \& Student s1= new Student(); s1. setYearofschool( "sophonore"); Systen.out.printf("student Xs Xs Lives at Xs In In", s1.getFirstKane(), s1.getLastName(), s1.getAddress()); Q. Instructor f1= new instructor() f1. setFirsthame ("Linda"); f1. setLastVane("Schott"); System.out.printf("Dr. Xs x5 's email is xs, f1.getFirsthane(), f1. getLastName(), A1. getenail()); blic class Person f 4 usages private String firstNane; 4 usages private String lastNane; 4 usages private String aiddleInitial; 4 usages private String easil; 4 usages private String phone; 4 usages private String address; 4 usages private string dateofBirth; 1 usage public Person() f firsthane = "Jaguar"; LastMane = "Frida"; niddteinitial ="n/an; email = "beajaguaretanusa edu"; phone =2107841000"; address = "OneUniversityway"; doteofBirth = "Hay23, 2009"; J 1 usage public Person(String firstiaee, string LastWame, String aiddteInitial) 1 this. firstwane = firsthame: this. LastMane = LastMane; this. middeInitial = middteInitial; ema1l = "beajaguaretanusa, edu"; phone ="2107841000; Lab4_Jyreena_Ward - Person.java (c) newstudent.java x no usages public String getHiddleInitial() & return middleInitial; b no usages 1 related problem public string getEmail() \& return email; \} no usages public void setEnail(String email) f this. email = emaili; ) no usages public String getPhone( \{ return phone; \} no usages public void setPhone(String phone) t this. phone = phone; \} 1 usage : public String getAddress( ) return address; 3 no usages public void setAddress(String address) f 3 onjava ct newstudent.jowa b no usages public String getDateofBirth() \& return dateofBirth; \} no usages public void setDateofbirth(String dateofBinth) this. dateofbirth = dateofBirth; \} 2 usages public class Student extends Penson f 4 usages private String yearotschool; 4 usages private int creditsTaking; 1 usage public Student() year0fschool ="=; creditsTaking =0; s no usages public Student(String firstWane, String LastWane, String aiddeleInitial, String year0fSchool, int ereditsTaking) f super(firsthame, LastMane, niddleinitial); this. year0fSchool = year0fsehool; this. creditstaking = ereditsTaking; f no usages public String getYear0fschool() \& return year0fschool; 1 usage public void setYearofschoot(string yeanofschool) \& this.yearofschoot = year0fschoot; b no usages public int getcreditsTaking() t return creditsTaking; b no usages public void setCreditsTaking(int creditsTaking) f this. creditsTaking = creditsTaking; b no usages 1 related problem private class Instructor f 2 usages private String officeRoonNumber; no usages public Instructor() \{ II default constructor \} no usages public String getofficeRoonNunber() f b return officeRoonWunber: no usages public void setofficeRoonkunber(String officeRoonNunber) \& this.officeRoonNunber = officeRoonUuber; f 2 usages private String officeRoomNumber; no usages public Instructor() \{ II default constructor \} no usages public string getofficeRoomNumber() f return officeRoomNumber; 3 no usages public void setofficeRoomNumber (String officeRoomNumber) \{ this. officeRoomNumber = officeRoomNumber; \} Description: Previously, we created a simplified Course Registration system. The system contains three classes: Student, Instructor, and Course. For that example, we created the Student class and Instructor class separately. But, obviously, the Student and instructor classes shares many similarities. For this lab, you want to create a Person class and put the common data fields and methods of the Student and Instructor classes into the Person class. Then, create the Student and Instructor classes and let them inherit the Person class. Task: Design and implement the three classes according to the UML diagram in Figure. After finishing the three classes, use the code in Figure 2 to test them. Figure 2 Submission: You need to submit two things: - The Java file(s) - A screenshot of the output of your test class Rubric: - Comments describing the program: 10 points - Correct indentation of each code block: 5 points - Person() class; 30 points - Student() class: - Instructor() class: 25 points - Screenshot 25 points 5 points

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

Step: 3

blur-text-image

Ace Your Homework with AI

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

Get Started

Students also viewed these Databases questions