Question: Method Overloading Billing Create a new Java file called BillingYourLastName with a public static void main. Create three overloaded computePhotoBill() methods for Shutterfly. When computePhotoBill()

Method Overloading Billing

Create a new Java file called BillingYourLastName with a public static void main.

Create three overloaded computePhotoBill() methods for Shutterfly.

When computePhotoBill() receives a single double parameter, it represents the price of one photo book ordered. Add 6% tax and return the total due as a double.

When computePhotoBill() received two parameters, they represent the price of a photo book and the quantity ordered (int). Multiply the two values, add 6% tax and return the total due.

Finally, when computePhotoBill() receives three parameters, they represents the price of a photo book, the quantity ordered, and a coupon value. Multiple the quantity and price, reduce the result by the coupon value and then add 6% tax and return the total due.

In the main method, call each method testing to make sure you receive the correct values and back. For example, with these calls (using printf to two decimals), I would receive the following:

computePhotoBill(19.99); // 21.19

computePhotoBill(19.99, 2); // 42.38

computePhotoBill (19.22, 2, .1); // 36.67

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!