Question: //Help with this probelm please! written in C Important Notes: 1. Formatting: Make sure that you follow the precise recommendations for the output content and

//Help with this probelm please! written in C

Important Notes:

1. Formatting:

Make sure that you follow the precise recommendations for the output content and formatting: for example, do not change the text in the first problem from Please enter item data (part number, quantity, price): to Enter the item : .The assignment will be auto - graded and any changes in formatting will result in a loss in the grade.

2. Comments:

Header comments are required on all files and recommended for the rest of the program. Points will be deducted if no header comments are included.

3. Restriction:

The use of goto statements anywhere within this program is prohibited. Points will be deducted if goto is used.

4. Your program must write to the file in binary mode, using the fwrite function

Problem 1:

Write a program to repeatedly ask the user to enter information regarding inventory for a business (item part number, quantity, price) and then saves the information to a file called inventory.txt. The program stops the loop when the user enters 0 for the part number.

The program should function as follows (items in italics are to be entered by the user):

This program stores a business inventory.

Please enter item data (part number, quantity, price): 3, 1, 2.4

Please enter item data (part number, quantity, price): 1, 4, 3.0

Please enter item data (part number, quantity, price): 0

Thank you. Inventory stored in file inventory.txt.

//Help with this probelm please! written in C Important Notes: 1. Formatting:

Problem 2:

Write a program to read information from the inventory.txt file and display it to the screen, formatted as follows: Part#, Quantity, and Item Price in the table header should be separated by tabs. The part number field should take 5 spaces (values right justified), the quantity field should take 8 spaces (values right justified), and the price field should take 9 spaces with 2 numbers after the decimal (values right justified, with the $ sign in front of the price).

Note: Your program must read from the file in binary mode, using the fread function

The program should function as follows:

Make sure that you follow the precise recommendations for the output content

Full problem:

and formatting: for example, do not change the text in the first

Formatting: Make sure that you follow the precise recommendations for the output content and formatting: for example, do not change the text in the first problem from "Please enter item data (part number, quantity, price):"to "Enter the item: ". Your assignment will be auto-graded and any changes in formatting will result in a loss in the grade Comments: Header comments are required on all files and recommended for the rest of the program. Points will be deducted if no header comments are included Restriction: The use of goto statements anywhere within this program is prohibited. Points will be deducted if goto is used 1. 2. 3. Problem 1 Write a program to repeatedly ask the user to enter information regarding inventory for a business (item part number, quantity, price) and then saves the information to a file called inventory.txt. The program stops the loop when the user enters 0 for the part number. The program should function as follows (items underlined are to be entered by the user): This program stores a business inventory Please enter item data (part number, quantity, price): 3, 1, 2.4 Please enter item data (part number, quantity, price): 1. 4, 3.0 iease enter item data (part number, quantity, price): 0 Thank you. Inventory stored in file inventory.txt Note: .Your program must write to the file in binary mode, using the fwrite function

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!