Question
Please answer all the 4 questions below with explanation: Suppose the class named DiscountSale is a derived class of a class called Sale. Suppose the
Please answer all the 4 questions below with explanation:
Suppose the class named DiscountSale is a derived class of a class called Sale. Suppose the class Sale has instance variables named price and numberOfItems. Will an object of the class DiscountSale also have instance variables named price and numberOfItems?
Suppose the class named DiscountSale is a derived class of a class called Sale, and suppose the class Sale has public methods named getTotal and getTax. Will an object of the class DiscountSale have methods named getTotal and getTax? If so, do these methods have to perform the exact same actions in the class DiscountSale as in the class Sale?
Suppose the class named DiscountSale is a derived class of a class called Sale, and suppose the class Sale has a method with the following heading and no other methods named getTax, as follows:
public double getTax()
And suppose the definition of the class DiscountSale has a method definition with the following heading and no other method definitions for methods named getTax, as follows:
public double getTax(double rate) How many methods named getTax will the class DiscountSale have and what are their headings?
The class HourlyEmployee (Display 7.3) has methods named getName and getRate (among others). Why does the definition of the class HourlyEmployee contain a definition of the method getRate but no definition of the method getName?
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