Question: Amazon is looking for you to design an inventory search system that will quickly tell their customers if the SKU # (Stock-keeping unit) of the
Amazon is looking for you to design an inventory search system that will quickly tell their customers if the SKU # (Stock-keeping unit) of the product they are looking for is an item they carry, and if they have it in stock. You are going to create a C++ program that has the following features:
a) Your program will use functions.
b) The SKU # is stored in an array of structs of 1000 elements (this is for simplicity purposes). The array will be populated through a random-number generator.
c) For testing purposes, once the array is populated you will display the SKU # of the element with subscript 500 of the unsorted array.
d) Prompt the user for an SKU to search for, and use the binary search method. The program will either say that it is in the inventory and the quantity of the product available or say that Amazon does not carry that product.
e) You may use the snippets of code below or in your textbook as a reference to create your code.
Populating the array of structs with random SKU numbers
![void InsertRandom(invStruct inventory []) {// Random number generator srand (time()); for (int x = 0 ; x< 1000 ; x++) { inve](https://dsd5zvtm8ll6.cloudfront.net/si.experts.images/questions/2022/08/62fe404dd5636_1660829774192.jpg)
Selection Sort
![36 / 37 selection Sort • This function sorts an int array in ascending order.. 39 ***** ***** 40 void selectionsortint array]](https://dsd5zvtm8ll6.cloudfront.net/si.experts.images/questions/2022/08/62fe404e99ebf_1660829774355.jpg)
Binary Search
![int binarySearch(const int array[], int size, int value) {int first -0. // Pirst array element last - size - 1, // Last arra](https://dsd5zvtm8ll6.cloudfront.net/si.experts.images/questions/2022/08/62fe404ea4c29_1660829774521.jpg)
Sample output


void InsertRandom (invStruct inventory []) { // Random number generator } srand (time(0)); for (int x = 0; x < 1000; x++) { } inventory [x].skuNo= rand() % 99999999 + 1; inventory [x].qty = rand() % 100 + 1;
Step by Step Solution
3.39 Rating (165 Votes )
There are 3 Steps involved in it
include include include include ... View full answer
Get step-by-step solutions from verified subject matter experts
