Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

in ( Java programming language) please help me with it thank you Post lab A HighSchool application has a super class: Person. Using inheritance, you

image text in transcribed

image text in transcribed

in ( Java programming language) please help me with it thank you

Post lab A HighSchool application has a super class: Person. Using inheritance, you will create two new classes, Teacher and Student. A Teacher will be like Person but will have additional properties such as salary (the amount the teacher earns) and subject (e.g the Person class with additional properties (student ID and GPA) You can start with following classes: er Science, 'Chemistry. 'English, 'Other"). The Student class is derived from class Person protected String name; II name of the person protected int age; l person's age protected String gender; I/ "M" for male, "F" for female public Person(String name, int age, String gender)t this.name name; this.age age; this.gender gender @Override public String toString)( return name+ ", age:"+ age+".gender: " +gender Requirements i. Add "setters" and "getters" for all instance variables in the Person class and Student class. i. Write Student class that extends the parent class Person. a) Add two protected instance variables to the class for id (int) and GPA double). Choose appropriate names for the instance variables

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

Recommended Textbook for

More Books

Students also viewed these Databases questions