Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

Step: 1

blur-text-image

Get Instant Access with AI-Powered Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Students also viewed these Databases questions