The description is below: Read the Description Read the Description Read the Description Read the Description To the exp

Business, Finance, Economics, Accounting, Operations Management, Computer Science, Electrical Engineering, Mechanical Engineering, Civil Engineering, Chemical Engineering, Algebra, Precalculus, Statistics and Probabilty, Advanced Math, Physics, Chemistry, Biology, Nursing, Psychology, Certifications, Tests, Prep, and more.
Post Reply
answerhappygod
Site Admin
Posts: 899604
Joined: Mon Aug 02, 2021 8:13 am

The description is below: Read the Description Read the Description Read the Description Read the Description To the exp

Post by answerhappygod »

The description is below:
Read the Description
Read the Description
Read the Description
Read the Description
To the experts who have responded to my questionsbefore, you need to add to your code. Update the code provided towork as below. Change to work with A001 item codes instead ofintegers (1-10), meaning changing the input file to…
A001,candy,1.00.
A002,....
Print the item code, name, and price at the start. Itemcodes that start with B should not have sales tax. Be able toupdate item data.
Read the description. You are not helping by posting thesame thing each time.
The Description Is Below Read The Description Read The Description Read The Description Read The Description To The Exp 1
The Description Is Below Read The Description Read The Description Read The Description Read The Description To The Exp 1 (44.78 KiB) Viewed 18 times
In this program, you are to write a Java Program that emulates cash register at a Grocery Store. To make the problem simple, we assume that there are 9 different items for sale and each item with its unique code 1 through 9 . The following table shows the item code, item name and unit price: The item code type is String. Item codes that start with B does not have 6% sales tax. The input file is now provided CSV format as shown: A001, bottled water, 1.50 A002, Candy, 1.00 .. Minimally, your program must have at least two classes: Item, CashRegister. The Item class is for the item data with three attributes: itemCode, itemName, and ynitPrice. The CashRegister class manages the sale. You are encouraged to include more classes. For example, you can have the Sale class that keeps the sale records. Assume that a clerk in a grocery store uses your program to get the total of the sales items. Make the main class name as CashRegister.java. The following shows a sample run of the cash register system: jodare HW2-LastName -java \$java HW2-LagtName.java java HW2-LastName.java Welcome to POST system! Input file: items.tyt Beginning a new sale (Y/N) y;both the upper and lower cage should work
; Handle exception ; the output ghould be properly aligned ; if lesg amount is entered, agk again
Do you want to update the items data? (A/D/M/Q):Q Thanks for using POST syatem. Goodbye. In the sample run, the bold face letters are output from the cash register system and non-bold italicized letters are input from the user. The user enters ' 1 ' to terminate each current sale. The system is terminated if the user enters ' N ' on Beginning a new sale (Y/N). Then, the POST system prints out the total sale amount of the day. Once the modification is done, the items data are written back to the input file.
Your program should compile and run in the command line environment. All user input needs to be checked properly to avoid exceptions. Suggestions: Provide methods (or functions) that perform the following tasks: - Accepts the item code for each item for sale - Get the item name and print the name - Accepts the quantity of the item - Computes the item total for each item - Lists the quantity, name, and price for all sale items in sorted order, and get the subtotal of all items purchased - Computes the total sales amount with tax - Initialize the item purchase list (for each new sale) Use arrays for the item data. That is, you are not allowed to use other data types like Afravitist, Vector, Set, etc. Provide two sample runs: one for your own that has three sales and one that is shown above follow the exact same input sequence: if not, points will be deducted. Provide screen images of the output: "hw1-out1.jpg" and "hw1-out2.jpg" for the two sample runs. Make sure that the screen image is easily readable with proper size.
Join a community of subject matter experts. Register for FREE to view solutions, replies, and use search function. Request answer by replying!
Post Reply