Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Question 3 (10 points) Write a program that reads from the standard input an inventory file using the following format: Product ID price per unit
Question 3 (10 points) Write a program that reads from the standard input an inventory file using the following format: Product ID price per unit Number of units available The file starts with an integer to indicate the number of records, followed by records each record in a separate line The first two fields are in every record. The third field if 0 it is not there at all, for example AC 1234 KO1234 BB9876 132.25 412.67 305.00 12 That means the second product has 0 units Your program calculates the total inventory value and display it as a left justified floating point number with two decimal digits (%.2f note there is a decimal point before the 2) followed by a new line character. Constraints: . ID is a 6-character string . The maximum number of records in the file is 30
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