Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Console app : A store only sells 4 items: Milk (barcode 811; $4.50 per gallon; 0% sales tax), dish detergent (barcode 120; $9.32 per container;
- Console app: A store only sells 4 items: Milk (barcode 811; $4.50 per gallon; 0% sales tax), dish detergent (barcode 120; $9.32 per container; 9.45% sales tax), newspapers (barcode 345; $1.50 each; 4.25% state tax) and boxes of cigarettes (barcode 012; $15 each; 120% sales tax). Develop a program for a point of sale (POS) machine that does the following:
- Waits for the cashier to type in checkout or logout; if the latter, exit the application; else for checkout go thru following steps:
- scan each item on one line, user will enter the barcode, a space, and then quantity. For each item:
- Check if the barcode is recognized and quantity is numeric and > 0. If either not met, print an error message and go back to (b).
- Calculate subtotal and tax (applying correct tax for the item) and add to order total.
- Add item line to receipt string.
- Repeat (b) until a blank line is entered, then calculate and print a receipt similar to the following in format (note column alignments):
Milk $ 4.50 x 5 $ 22.50
Dish Det $ 9.32 x 1 $ 9.32
---------------------------------------------------
Subtotal $ 31.82
Tax $ 0.88
---------------------------------------------------
Total $ 32.70
- Return to step (a)
The application must validate all user input and give appropriate messages to the user if invalid data is entered; the program should not fail or end prematurely.
*****do in C#********
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