Answered step by step
Verified Expert Solution
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 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
please solve it
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started