Make into a java code


Write a program to demonstrate the supermarket software.
Your program should:
1. Ask the user to enter an input filename
The file contains grocery items, quantity and unit cost. The grocery item is on the first line and quantity and unit cost on the second line.
You must create your own file and place it in the input/ folder of your Eclipse project
Your file must have at least 5 items in the format


(5 sample items are shown below):
1) Apples
2)10 10.25
3) Bananas
4)15 4.56
5) Grapes
6)8 9.55
7)0range Juice
8)1 3.50
9) Organic Milk
10)1 4.99
11)
1. Ask the user to enter an output filename
2. Open the input file and read products and items and store their values in variables
3. Use a
loop to
o Calculate total for each item and grand total.
o Produce formatted output of results to the console and to a file.
5. Sample Output to Console



Please enter an input filename: input/grocery.txt
Please enter an output filename: output/report.txt
Shop OK Report
Item
Quantity
Price ($)
Total
Apples
10
10.25
102.50

Bananas
15
4.56
68.40

Grapes
8
9.55
76.40

Orange Juice
1
3.50
3.50


Organic Milk
1
4.99
4.99



Grand Total
($)
255.79




6. Sample Output to File

Shop OK Report
4 Item
Quantity
price
8 Apples
bananas
10 Grapes
15
10.25
4.56
9.55
3.50
102.50
68.46
76.40
3.50
Grand Total
(8)
255.79

Respuesta :

Otras preguntas

Q&A Education