Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

QUESTION 1 * Consider the following Student class which models a Student. Student class.txt And do the following : - Do the necessary changes to

QUESTION 1
* Consider the following Student class which models a Student.
Student class.txt
And do the following :
- Do the necessary changes to make the class abstract.
- An abstract method getTotalTuition().
* Consider a subclass FreshStudent.
- FreshStudent has two additional instance variable Transportation (int), Books (int) all private.
- Write an appropriate constructor for each of the classes making use of the constructor of the superclass in defining those of the subclasses.
- override getTotalTuition() method that returns
*The total Tuition for a student after adding the Transportation and Books of (FreshStudent).
Tuition + Transportation + Books
- Override also toString() method for each class making use of the toString() method of the superclass in defining those of the subclasses.
(toString() should return something that can be printed on the screen).
* Create the following object from the subclass and print it on the screen.
Student r1= new FreshStudent(201906523,"Sara Abdulaziz",65000,5000,2500);

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_2

Step: 3

blur-text-image_3

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