Invoice App v2
Invoice Application Version 2
-
Create a copy of your InvoiceApplicationV1 class and call it InvoiceApplicationV2
- ā¾ š src
- ā¾ š¦ (default package)
-
š AreaAndPerimeterApp.java
-
š GradeConverter.java
-
š InvoiceApplication.java
-
š InvoiceApplicationV1.java
-
š InvoiceApplicationV2.java
-
-
Modify the code so that it continues to take input from the user y/n to continue or not.
- The discount is determined based on the value of subtotal (>=500, discount is 0.25, >-200, discount is 0.2, >=100, discount is 0.1). For values less than 100 no discount is applied.
- When the user is finished (enters ānā), calculate the number of invoices, average value and average discount as shown below.
Console Output
Welcome to the Invoice Total Calculator
Enter Subtotal: 200
Discount percent: 0.2
Discount amount: 40.0
Total: 160.0
Continue? (y/n): y
Enter Subtotal: 600
Discount percent: 0.25
Discount amount: 150.0
Total: 450.0
Continue? (y/n): y
Enter Subtotal: 100
Discount percent: 0.1
Discount amount: 10.0
Total: 90.0
Continue? (y/n): y
Enter Subtotal: 50
Discount percent: 0.0
Discount amount: 0.0
Total: 50.0
Continue? (y/n): n
Number of invoices: 4
Average invlice: 187.5
Average discount: 66.66666666666667