Answered step by step
Verified Expert Solution
Link Copied!

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

image text in transcribed

image text in transcribed

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

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Oracle 10g SQL

Authors: Joan Casteel, Lannes Morris Murphy

1st Edition

141883629X, 9781418836290

More Books

Students also viewed these Databases questions