Question: A session with the program: Enter operation code: i Enter part number: 5 2 8 Enter part name: Disk drive Enter quantity on hand: 1
A session with the program:
Enter operation code: i
Enter part number:
Enter part name: Disk drive
Enter quantity on hand:
Enter operation code: s
Enter part number:
Part name: Disk drive
Quantity on hand:
Enter operation code: s
Enter part number:
Part not found.
Enter operation code: i
Enter part number:
Enter part name: Printer cable
Enter quantity on hand:
Enter operation code: u
Enter part number:
Enter change in quantity on hand:
Enter operation code: s
Enter part number:
Part name: Disk drive
Quantity on hand:
Enter operation code: p
Part Number Part Name Quantity on Hand
Disk drive
Printer cable
Enter operation code: q
Steps:
The program will store information about each part in a structure.
The structures will be stored in an array global named inventory.
A global variable named numparts will keep track of the number of parts currently stored in the array.
An outline of the programs main loop:
for ;;
prompt user to enter operation code;
read code;
switch code
case i: perform insert operation; break;
case s: perform search operation; break;
case u: perform update operation; break;
case p: perform print operation; break;
case q: terminate program;
default: print error message;
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
