Question: FOR JAVA: Summary: Create program to calculate sales tax The solution file should be named CreatePurchase.java Include these steps: Create a class named Purchase. Each

FOR JAVA:

Summary: Create program to calculate sales tax

  • The solution file should be named CreatePurchase.java
  • Include these steps:
    • Create a class named Purchase. Each Purchase contains an invoice number, amount of sale, and amount of sales tax.
    • Include set methods for the invoice number and sale amount.
    • Within the set() method for the sale amount, calculate the sales tax as 7.5% (using a static field in the Purchase class) of the sale amount.
    • Also include a display method that displays a purchase's details in a well formatted output display.
    • Prompt the user for invoice number and amount of sale. When you prompt for amount of sale, do not proceed until user has entered a nonnegative value.
    • Display invoice number, amount of sale, and sales tax.
  • Run your program until it works and the output looks nice.

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!