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.
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
Related questions
Question
Expert Solution
This question has been solved!
Explore an expertly crafted, step-by-step solution for a thorough understanding of key concepts.
Step by step
Solved in 2 steps with 1 images
Knowledge Booster
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.Recommended textbooks for you
C++ for Engineers and Scientists
Computer Science
ISBN:
9781133187844
Author:
Bronson, Gary J.
Publisher:
Course Technology Ptr
C++ Programming: From Problem Analysis to Program…
Computer Science
ISBN:
9781337102087
Author:
D. S. Malik
Publisher:
Cengage Learning
Systems Architecture
Computer Science
ISBN:
9781305080195
Author:
Stephen D. Burd
Publisher:
Cengage Learning
C++ for Engineers and Scientists
Computer Science
ISBN:
9781133187844
Author:
Bronson, Gary J.
Publisher:
Course Technology Ptr
C++ Programming: From Problem Analysis to Program…
Computer Science
ISBN:
9781337102087
Author:
D. S. Malik
Publisher:
Cengage Learning
Systems Architecture
Computer Science
ISBN:
9781305080195
Author:
Stephen D. Burd
Publisher:
Cengage Learning