My IDE : NETBEAN JAVA THANK YOU SO MUCH ( THE QUESTION IS ON SPECIFICATION) Sample Run Department...

50.1K

Verified Solution

Question

Programming

My IDE : NETBEAN JAVA

THANK YOU SO MUCH ( THE QUESTION IS ON SPECIFICATION)

Sample Run

Department Store Sales Tax and Grand Total Application

Data Entries: Enter 0 to end your input
Cost of item: 35.99
Cost of item: 27.50
Cost of item: 19.59
Cost of item: 0
All items total: $83.08

Sales tax rate (%): 6
Promotion code: 123

Discount amount: $1.00
Subtotal: $82.08
Sales tax amount: $4.92
Grand total: $87.00

Continue? y/Y/n/N: y

Data Entries: Enter 0 to end your input
Cost of item: 10.99
Cost of item: 35.50
Cost of item: 11.52
Cost of item: 21.58
Cost of item: 0
All items total: $79.59

Sales tax rate (%): 12
Tax rate should be from 6 to 10
Sales tax rate (%): 9
Promotion code: 456

Discount amount: $2.00
Subtotal: $77.59
Sales tax amount: $6.98
Grand total: $84.57

Continue? y/Y/n/N: y

Data Entries: Enter 0 to end your input
Cost of item: 95.21
Cost of item: 0
All items total: $95.21

Sales tax rate (%): 10
Promotion code: 999
Invalid promotion code. Try again
Promotion code: 789

Discount amount: $3.00
Subtotal: $92.21
Sales tax amount: $9.22
Grand total: $101.43

Continue? y/Y/n/N: Y

Data Entries: Enter 0 to end your input
Cost of item: 152.50
Cost of item: 59.80
Cost of item: 0
All items total: $212.30

Sales tax rate (%): 8

Discount amount: $21.23
Subtotal: $191.07
Sales tax amount: $15.29
Grand total: $206.36

Continue? y/Y/n/N: N

Program is terminated

Specifications

  • The sales tax rate is from 6% to 10%.
  • The system accepts only the following promotion codes for adiscount amount:
    • 123 ($1 discount)
    • 456 ($2 discount)
    • 789 ($3 discount)
    • 0 (no discount)
  • If the all items total is $100 or more, the discount amount is10% of the total. No other discounts are applied.
  • The methods should round the results to a maximum of twodecimal places. The subtotal, the sales tax amount, and the grandtotal are calculated as follows:
    • subtotal = all items total - discount amount
    • sales tax amount = subtotal * (sales tax rate / 100)
    • grand total = subtotal + sales tax amount
  • Store the code that gets user inputs and displays outputs inthe main method.
  • Your project should contain one main class that defines thefollowing static methods:
    • main()
    • getDiscount()
    • getItemsTotal()
    • getSalesTax()

Answer & Explanation Solved by verified expert
3.7 Ratings (390 Votes)
Java program that prompts the user to enter the cost of itemsuntil user enters 0 to stop reading items Then display the total itemscost then prompt for sales tax in a range of 6 to 10 Then prompt forthe promo code if the total amount    See Answer
Get Answers to Unlimited Questions

Join us to gain access to millions of questions and expert answers. Enjoy exclusive benefits tailored just for you!

Membership Benefits:
  • Unlimited Question Access with detailed Answers
  • Zin AI - 3 Million Words
  • 10 Dall-E 3 Images
  • 20 Plot Generations
  • Conversation with Dialogue Memory
  • No Ads, Ever!
  • Access to Our Best AI Platform: Flex AI - Your personal assistant for all your inquiries!
Become a Member

Other questions asked by students