Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Using C++, code the following: You need to write a program to keep inventory for a hardware store five different ways. You will write a

Using C++, code the following:

image text in transcribed

You need to write a program to keep inventory for a hardware store five different ways. You will write a program to store the inventory in (1) an unsorted doubly linked list, (2) a sorted doubly linked list, (3) an unsorted array, (4) store array, and (5) position array (i.e. use index/subscript to access record, e.g., Record #83 would be loaded into array index location 83). Make the arrays big enough to store 100 records. Each record will contain Record # (int), Tool Name (string), Quantity (int) and Cost (double) Your program should initialize the array to 100 empty records. Record #, Quantity and Cost set to zero and Tool Name set to 'no name'. Read in a file of unsorted records to create options (1), (2) and (3) and a separate file sorted records to create of options (4) and (5). The program will ask the user to enter the names of the files to use. Use the '#' as the delimiter for the name. For example, the first data line in the file would look like 83 #Electric Sander# 7 57.00 Then create a menu that allows you to Update a record (Record # cannot be updated), Delete a record, List a record, and list All tools (the ones that are not "no name"). Start your inventory with the following information Perform linear searches to perform the update, delete and list operations (except the position array). For each operation write to an output file the operation and number of comparisons necessary to perform each operation in all five ways. After running your program for various inputs write a summary conclusion on the efficiency of performing the operations in the five ways

Step by Step Solution

There are 3 Steps involved in it

Step: 1

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