Question
create a Java CLI application that enables a store owner to enter sales information in order to produce a detailed invoice. The store owner will
create a Java CLI application that enables a store owner to enter sales information in order to produce a detailed invoice.
The store owner will enter the invoice number, name of the item, and amount of sale. In turn, the application will create the invoice number, check the item name, calculate sales tax and output the invoice with all pertinent information to include the final bill.
Lab Parameters
Using Exercise 14A and 14B on page 350 of the textbook as a starting point, create an application with the following: (book nume is Joyce Farrell (2016). Java Programming, 8th Edition (Print ISBN: 9781285856919)
- Create a class named "Purchase" (The Purchase.java file used to create the objects). Each Purchaseobject contains following:
- The name of the item (private attribute)
- An invoice number (private attribute)
- An amount of sale (private attribute)
- An amount of sales tax (private attribute)
- A getter/setter method for the invoice number (public method)
- A getter/setter method for sale amount (public method)
- A getter/setter method for the item name (public method)
- Within the setter of sale amount, calculate the sales tax as 6% of the sale amount. (Note:Textbook uses 5% but I would like you to use 6% as the sales tax)
- A display method that outputs purchase's details.
- Note: Use of constructor(s) is optional.
- Create an application class CreatePurchase.java that instantiates the Purchase object and prompts the users for purchase details. Notice some requirements:
- DO NOT let the user proceed until a number between 1000 and 8000 has been entered.
- DO NOT let the user proceed until a non-negative value is entered for the sale amount.
- Include a means to limit item names to at least five different specific item names
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