Write a function called checkStock to receive a pointer to the address of the first element of the array and the number of elements in the array. The minimum number of each item that must be in stock is 100. Find the items with less than 100 in stock. For each of these items calculate the number that must be ordered so that the number in stock is 100. Display the number of the item, the number currently in stock and the number to order to have 100 of the item in stock. Display the values neatly in columns as shown in the example below. Also calculate the total number of items to order in the function and return this value to the main function. This value and a suitable label must be displayed from the main function.

C++ for Engineers and Scientists
4th Edition
ISBN:9781133187844
Author:Bronson, Gary J.
Publisher:Bronson, Gary J.
Chapter10: Pointers
Section10.4: Passing Addresses
Problem 6E
icon
Related questions
Question
Example of output:
List of stock to order
Item Nr
01
04
06
08
09
In stock To order
73
27
76
24
91
13
87
45
55
Total number of items to order: 330
Transcribed Image Text:Example of output: List of stock to order Item Nr 01 04 06 08 09 In stock To order 73 27 76 24 91 13 87 45 55 Total number of items to order: 330
Write a function called checkStock to receive a pointer to the address of the first element of the array and
the number of elements in the array.
The minimum number of each item that must be in stock is 100.
Find the items with less than 100 in stock. For each of these items calculate the number that must be
ordered so that the number in stock is 100.
Display the number of the item, the number currently in stock and the number to order to have 100 of the
item in stock. Display the values neatly in columns as shown in the example below.
Also calculate the total number of items to order in the function and return this value to the main function.
This value and a suitable label must be displayed from the main function.
Transcribed Image Text:Write a function called checkStock to receive a pointer to the address of the first element of the array and the number of elements in the array. The minimum number of each item that must be in stock is 100. Find the items with less than 100 in stock. For each of these items calculate the number that must be ordered so that the number in stock is 100. Display the number of the item, the number currently in stock and the number to order to have 100 of the item in stock. Display the values neatly in columns as shown in the example below. Also calculate the total number of items to order in the function and return this value to the main function. This value and a suitable label must be displayed from the main function.
Expert Solution
steps

Step by step

Solved in 2 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++ for Engineers and Scientists
C++ for Engineers and Scientists
Computer Science
ISBN:
9781133187844
Author:
Bronson, Gary J.
Publisher:
Course Technology Ptr
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
Systems Architecture
Systems Architecture
Computer Science
ISBN:
9781305080195
Author:
Stephen D. Burd
Publisher:
Cengage Learning