Question: 2) Consider the following class: public class SaleTransaction { private double myOriginalPrice; private double myDiscountRate; public SaleTransaction(double price, double discountrate) { myOriginalPrice = price; myDiscountRate=

2) Consider the following class:

public class SaleTransaction {

private double myOriginalPrice;

private double myDiscountRate;

public SaleTransaction(double price, double discountrate) {

myOriginalPrice = price; myDiscountRate= discountrate;

}

public double getPrice(){

return myOriginalPrice;

}

public double getDiscount(){

return myDiscountRate;

}

}

A StaffSale Transaction is-a SaleTransactiob that has an additional staff discount rate. This rate for a staff transaction will be the sum of both discount rates if this sum is less than 0.75. Otherwise, the higher rate will be applied. Write the StaffSale Transaction class

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!