Write a complete C program that manages the inventory of a warehouse with 4 different categories of items. The program should: (i) Prompt the user to input the quantity of each category in stock. Apply a 2D array to store the quantities. (ii) Identify which category has the highest stock quantity. Apply a non-return value function, include a parameter list if necessary. (iii) Identify which category has the lowest stock quantity. Apply a non-return value function, include a parameter list if necessary. (iv) Calculate the average stock quantity for all categories and display it. Apply a return value function, include a parameter list if necessary. (v) Determine whether each category is well-stocked or needs restocking by comparing its quantity to the average stock quantity. If a category's quantity is greater than or equal to the average, then it's well-stocked; otherwise, it needs restocking. Requirements: Apply a 2D array. Use functions for better modularization. Display the results clearly for each category. Sample Output: Enter quantities for - Category A: 200 Category B: 150 Category C: 180 Category D: 120 5000 unitel

C++ Programming: From Problem Analysis to Program Design
8th Edition
ISBN:9781337102087
Author:D. S. Malik
Publisher:D. S. Malik
Chapter8: Arrays And Strings
Section: Chapter Questions
Problem 23PE
icon
Related questions
Question
Warning ⚠️ Don't post AI generated answer or plagiarised answer. If I see these things I'll give you multiple downvotes and will report immediately.
Write a complete C program that manages the inventory of a warehouse with 4
different categories of items. The program should:
(i) Prompt the user to input the quantity of each category in stock.
Apply a 2D array to store the quantities.
(ii) Identify which category has the highest stock quantity.
Apply a non-return value function, include a parameter list if necessary.
(iii) Identify which category has the lowest stock quantity.
Apply a non-return value function, include a parameter list if necessary.
(iv) Calculate the average stock quantity for all categories and display it.
Apply a return value function, include a parameter list if necessary.
(v) Determine whether each category is well-stocked or needs restocking by
comparing its quantity to the average stock quantity. If a category's quantity is
greater than or equal to the average, then it's well-stocked; otherwise, it needs
restocking.
Requirements:
Apply a 2D array.
Use functions for better modularization.
Display the results clearly for each category.
Sample Output:
Enter quantities for -
Category A: 200
Category B: 150
Category C: 180
Category D: 120
Highest Stock: Category A [200 units]
Lowest Stock: Category D [120 units]
Average Stock: 162.50 units
Category A: Well-stocked
Category B: Well-stocked
Category C: Well-stocked
Category D: Needs restocking
Transcribed Image Text:Write a complete C program that manages the inventory of a warehouse with 4 different categories of items. The program should: (i) Prompt the user to input the quantity of each category in stock. Apply a 2D array to store the quantities. (ii) Identify which category has the highest stock quantity. Apply a non-return value function, include a parameter list if necessary. (iii) Identify which category has the lowest stock quantity. Apply a non-return value function, include a parameter list if necessary. (iv) Calculate the average stock quantity for all categories and display it. Apply a return value function, include a parameter list if necessary. (v) Determine whether each category is well-stocked or needs restocking by comparing its quantity to the average stock quantity. If a category's quantity is greater than or equal to the average, then it's well-stocked; otherwise, it needs restocking. Requirements: Apply a 2D array. Use functions for better modularization. Display the results clearly for each category. Sample Output: Enter quantities for - Category A: 200 Category B: 150 Category C: 180 Category D: 120 Highest Stock: Category A [200 units] Lowest Stock: Category D [120 units] Average Stock: 162.50 units Category A: Well-stocked Category B: Well-stocked Category C: Well-stocked Category D: Needs restocking
Expert Solution
steps

Step by step

Solved in 3 steps with 1 images

Blurred answer
Knowledge Booster
Arrays
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
C++ Programming: From Problem Analysis to Program…
C++ Programming: From Problem Analysis to Program…
Computer Science
ISBN:
9781337102087
Author:
D. S. Malik
Publisher:
Cengage Learning
C++ for Engineers and Scientists
C++ for Engineers and Scientists
Computer Science
ISBN:
9781133187844
Author:
Bronson, Gary J.
Publisher:
Course Technology Ptr
Microsoft Visual C#
Microsoft Visual C#
Computer Science
ISBN:
9781337102100
Author:
Joyce, Farrell.
Publisher:
Cengage Learning,