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

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!