Question: 7. What is another name for the method with the name setTotal, and what is this method used for? 8. What is another name for

7. What is another name for the method with the name setTotal, and what is this method used for?
8. What is another name for the method with the name getDate, and what is this method used for?
9. Would the above class definition have a default constructor? Explain your answer
Suppose that you have the following class definition 2 public class Receipt f private double total; private double tax; private String date; 8 public double getTotalO t return total; 10 12 public void setTotal (double total) 13 14 15 16 public double getTaxO 17 18 19 20 public void setTax(double tax) 21 this.total total; return tax this.tax-tax; 23 24 public String getDateO 25 26 27 28 public void setDate(String date) 29 30 31 return date this.date date; e0verride public String toStringO return "Receipt total-"total + "tax-"+tax", date"+date"]" 35 36 37 38
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
