Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

Step: 1

include include include include ... blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Systems analysis and design

Authors: Alan Dennis, Barbara Haley Wixom, Roberta m. Roth

5th edition

978-1118057629, 1118057627, 978-111880817

More Books

Students also viewed these Computer Engineering questions

Question

Why do objects illuminated by moonlight lack color?

Answered: 1 week ago