Invoicing.java Create a class named Invoicing (no instance private data fields) that includes three overloaded computeInvoice() methods and one displayDetails() method for a book store: see pages 140...






Invoicing.java



Create a class named Invoicing (no instance private data fields) that includes

three overloaded computeInvoice() methods and one displayDetails() method for

a book store:



see pages 140 and 183 for examples...



* Define a constant for the 8% tax rate at the top of the Invoicing class.

Set the TAXRATE double constant to 0.08. Do not set to a whole number.

When computeInvoice() receives a single parameter, it represents the price

of one book ordered. Calculate the tax using the TAXRATE constant. Add the tax

to the price and save the total due in a variable. Call the displayDetails()

method, defined in the computeInvoice() class, being sure to pass the total due

as an argument to the display method.



* When computeInvoice() receives two parameters, they represent the price of

a book and the quantity ordered. Multiply the price times quantity, calculate the

tax using the TAXRATE constant, and calculate the total due. Call the

displayDetails() method, defined in the computeInvoice() class, being sure to

pass the total due as an argument to the display method.



* When computeInvoice() receives three parameters, they represent the price

of a book, the quantity ordered, and a coupon value. Multiply the quantity and

price, reduce the result by the coupon value. Then calculate the tax using the

TAXRATE constant and calculate the total due. Call the displayDetails()

method, defined in the computeInvoice() class, being sure to pass the total due

as an argument to the display method.



* The displayDetails() method receives the total as a parameter and prints the

total.






























TestInvoice.java

Create an application/driver program named TestInvoice with a main() method

that tests all three overloaded methods using the following data (do not

instantiate any objects):



Price $24.95

Price $17.50, quantity 4

Price $10.00, quantity 6, coupon $20.00




Jun 07, 2022
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here