Answered step by step
Verified Expert Solution
Question
1 Approved Answer
The file named Product Info.txt includes information about products sold at a home improvement store. Each row of information represents a transaction from a unique
The file named Product Info.txt includes information about products sold at a home improvement store. Each row of information represents a transaction from a unique customer. The first element of a row is the name of the product sold, the second is the price of the product and the third is the number of that product sold during the transaction. Note that you may not use arrays on this assignment. a. Create a directory in your IntelliJ project folder named input_data and place the Product Info.txt file in that directory. b. Create a class named H3_Q3.java and write code that reads the data from the file (hint: perhaps more than once) and determines the following: 1. How many unique customers purchased each item? 2. How much total revenue did the store make on each item in the file? Note that you may assume that only the following products are in the file: Saw, Table, Flashlight, Battery and Clamp. c. Create an output .txt file named Q3cOutput.txt in the output_files directory that prints a summary table with the following format. Product Name Unique Customers Toal Revenue Saw Table Flashlight Battery Clamp XXXX XXXX XXXX XXXX XXXX YYYY YYYY YYYY YYYY YYYY Specific alignment of each element in the table is not necessary, nor are the lines separating the rows. However, column headings should be included. Also, XXXX should be formatted as US Currency ($XX.XX). 2 Product Price Saw 8.56 Table 45 Table 45 Flashlight Battery 3.33 clamp 6 Flashlight Battery 3.33 Table 45 Flashlight Battery 3.33 clamp 6 Saw 8.56 Table 45 Amount 1 1 1 5.25 4 1 5.25 1 1 5.25 2 1 2 1 1 1 The file named Product Info.txt includes information about products sold at a home improvement store. Each row of information represents a transaction from a unique customer. The first element of a row is the name of the product sold, the second is the price of the product and the third is the number of that product sold during the transaction. Note that you may not use arrays on this assignment. a. Create a directory in your IntelliJ project folder named input_data and place the Product Info.txt file in that directory. b. Create a class named H3_Q3.java and write code that reads the data from the file (hint: perhaps more than once) and determines the following: 1. How many unique customers purchased each item? 2. How much total revenue did the store make on each item in the file? Note that you may assume that only the following products are in the file: Saw, Table, Flashlight, Battery and Clamp. c. Create an output .txt file named Q3cOutput.txt in the output_files directory that prints a summary table with the following format. Product Name Unique Customers Toal Revenue Saw Table Flashlight Battery Clamp XXXX XXXX XXXX XXXX XXXX YYYY YYYY YYYY YYYY YYYY Specific alignment of each element in the table is not necessary, nor are the lines separating the rows. However, column headings should be included. Also, XXXX should be formatted as US Currency ($XX.XX). 2 Product Price Saw 8.56 Table 45 Table 45 Flashlight Battery 3.33 clamp 6 Flashlight Battery 3.33 Table 45 Flashlight Battery 3.33 clamp 6 Saw 8.56 Table 45 Amount 1 1 1 5.25 4 1 5.25 1 1 5.25 2 1 2 1 1 1
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