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
Selection Sort
Binary Search
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
Step: 1
include include include include ...Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started