Question
Create a Java class named Invoicing that includes three overloaded computeInvoice() methods for a clothes store: - When computeInvoice() receives a single parameter, it represents
Create a Java class named Invoicing that includes three overloaded computeInvoice() methods for a clothes store:
- When computeInvoice() receives a single parameter, it represents the price of one shirt ordered. Add 8% tax, and display the total due. - When computeInvoice() receives two parameters, they represent the price of a store and the quantity ordered. Multiply the two values, add 8% tax, and display the total due. - When computeInvoice() receives three parameters, they represent the price of a shirt, the quantity ordered, and a coupon value. Multiply the quantity and price, reduce the result by the coupon value, and then add 8% tax and display the total due.
Create a driver class named TestInvoice with a main() method that tests all three overloaded methods using the following data:
- Price $24.95 - Price $17.50, quantity 4 - Price $10.00, quantity 6, coupon $20.00
Example Output:
Total price: $26.95
Total price: $75.60, quantity 4
Total price: $43.20, quantity 6, coupon $20.00
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started