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

Selection Sort

36 / 37 selection Sort • This function sorts an int array in ascending order.. 39 ***** ***** 40 void selectionsortint array]

Binary Search

int binarySearch(const int array[], int size, int value) {int first -0. // Pirst array element last - size - 1, // Last arra

Sample output

***** *Welcome to the Amazon.com Inventory Search System ***** ************************************************** The SKU #

Welcome to the Amazon.com Inventory Search System *** The SKU # of the element with subscript 508 is: 36560397 Please insert
 
 

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

1 Expert Approved Answer
Step: 1 Unlock

include include include include ... View full answer

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 Computer Engineering Questions!