Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

with java keep it simple pls Inheritance and polymorphism with java Our project named Lab7 contains the class main named Inheritance and two classes with

with java
keep it simple pls
image text in transcribed

Inheritance and polymorphism

with java

image text in transcribed
Our project named Lab7 contains the class main named Inheritance and two classes with the following members : Question 7.1: In the Person class: a. The first constructor diplays the message "Constructor 1 Person " b. The second constructor initialize the first and the last name of the person and displays the message "Constructor 2 Person " c. readPerson 0 method reads the first and the last names from the keyboard. d. ShowPerson0 displays the first and last name of the person. For the Student class : e. The first constructor diplays the message constructor 1 Student " f. The second constructor uses the keyword super(0 to initialize the first and the last names. It initializes the grade of the student and also displays the message "constructor 2 Student " g. readStudent0 method calls readPerson() method to read the first and the last names from the keyboard and reads the grade. h. showStudentO method displays the first and the last names of a student by calling the showPerson 0 method and shows the grade. In the main method, - Create an instance S1 of Student class with the first constructor, - Call readStudent method for SI, - Display the information of S1. Question 7.2 : In the main method, - Create an instance S2 of Student class with the second constructor ; - Display the information of S2. - Set the first name of S2. To do that, you should add the setFirst(String) method in Person class. Our project named Lab7 contains the class main named Inheritance and two classes with the following members: Question 7.1: In the Person class : a. The first constructor diplays the message " Constructor 1 Person n b. The second constructor initialize the first and the last name of the person and displays the message Constructor 2 Person n c. readPerson 0 method reads the first and the last names from the keyboard. d. ShowPerson0 displays the first and last name of the person. For the Student class : f. The second constructor uses the keyword super( to initialize the first and the last names. It initializes the grade of the student and also displays the message "constructor 2 Student g. readStudent0 method calls readPerson0 method to read the first and the last names from the keyboard and reads the grade. h. showStudentO method displays the first and the last names of a student by calling the showPerson 0 method and shows the grade. In the main method, - Create an instance S1 of Student class with the first constructor, - Call readStudent method for S1, - Display the information of S1. Question 7.2 : In the main method, - Create an instance S2 of Student class with the second constructor ; - Display the information of S2. - Set the first name of S2. To do that, you should add the setFirst(String) method in Person class

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

Database Modeling And Design

Authors: Toby J. Teorey, Sam S. Lightstone, Tom Nadeau, H.V. Jagadish

5th Edition

0123820200, 978-0123820204

Students also viewed these Databases questions

Question

What topics of interest can you use CPM Theory to investigate?

Answered: 1 week ago

Question

2. What are your challenges in the creative process?

Answered: 1 week ago