Question
Need help with this problem. Create a class named Purchase. Each Purchase contains an invoice number, amount of sale, and amount of sales tax. Include
Need help with this problem. 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 5% (using a static filed 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. Save the file as Purchase.java. Create an application that declares a purchase object and prompts the user for purchase details. When you prompt for an invoice number, do not let the user proceed until a number between 1000 and 8000 has been entered. When you prompt for a sale amount, do not proceed until the user has entered a nonnegative value. After a valid Purchase object has been created, display the object's invoice number, sale amount, and sales tax. Save the file as CreatePurchase.java
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