Question: IN JAVA Create an input file named items.txt with the following information: pen 2.5 15 Eraser 1.5 12 In the items.txt file, three consecutive lines
IN JAVA

Create an input file named items.txt with the following information: pen 2.5 15 Eraser 1.5 12 In the items.txt file, three consecutive lines contain information about a single item. First line contains item name (e.g., pen); next line contains item's unit price; and the line after contains quantity. Next three lines will contain information about the next item. In the items.txt file, we have information about two items. Write a program that will open the items.txt file and read the data from the file. For each item, your program needs to display the item name and total price where total price will be computed as follow: totalPrice = unitPrice * quantity Sample Output: Pen Total Price: 37.5 Eraser Total Price: 18 Note: for display, you can use console or file
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
