Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

please solve it using java Tost 4 - Consider an abstract superclass Student which models a Student. This class has: - Three private instance variables

please solve it image text in transcribed
using java
Tost 4 - Consider an abstract superclass Student which models a Student. This class has: - Three private instance variables Id (int) StudName (String) and Fees (int). - One constructor to initialize the instance variables. - An abstract method getFees(). - toStringO method to return the Id, StudName and Fees. - Consider a subelasses RegularStudent. - RegularStudent has only one additional instance variable Transportation (int) private. Write an appropriate constructor for each of the classes making use of the constructor of the superclass in defining those of the subelasse getFees0 method that returns o The total Fees for a student after adding the Transportation of (RegularStudent). F=F+T Override also toString 0 method for each class making use of the toString 0 method of the superclass in defining those of the subclasses. (toString 0 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 RegularStudent(201300234,"Samah Abdullah", 60000,4000); Output should be like the following

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

Understanding Oracle APEX 5 Application Development

Authors: Edward Sciore

2nd Edition

1484209893, 9781484209899