Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

image text in transcribed

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

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

Database Programming With Visual Basic .NET

Authors: Carsten Thomsen

2nd Edition

1590590325, 978-1590590324

More Books

Students also viewed these Databases questions

Question

1. Organize and support your main points

Answered: 1 week ago

Question

=+ Are they breakable for any reason?

Answered: 1 week ago