UMBC CMSC104 |
Project 3 is worth 100 points and due at midnight, Wednesday, 12 May.
Create a file named proj5.c, using the editor of your choice.
Sometimes programmers use parallel arrays in porgrams that must track more than one list of values that are related. For instance, suppose that you had to maintain an inventory, tracking the integer part numbers, name of the part, prices, and quantities of each item. This would require four arrarys: an integer part number array, an array of strings, a floating-point price array, and an integer quantity array. Each array would have the same number of elements (the total number of parts in the inventory). Write a program to maintain such an inventory, and reserve enough elements for 100 parts to be in the inventory. Present the user with an input screen. When the user enters a part number, search the part number array. As soon as you locate the position of the part, print the corresponding part name, price, and quantity. If the part does not exist, let the user add it to the inventory, along with the matching price and quantity.
This means that you will initialize some of the array when you write the program. You must let them keep looking up (or adding) items until they enter a sentinal value. (You may pick the sentinal value, but make sure to show this to the user.) You must use one function to input each of the values (or a total of four functions). You must also look up one of the items after you add it.
Compile the program with the following command:
If you got an error and you probably did, simply go back into the editor and fix it. Then recompile, continuing until you get no warnings or errors.
Execute the program with one of the two commands:
If everything worked correctly, you must run the program and look up
at least three items and add at least two items
Notice that the UNIX prompt must be on the next line!
Once you have everything absolutely correct, you must use the following set of commands to create the file that you will send to the TA for grading.
Notice that the first character in the TA's address is "ell", the last one is the number "one".
This project will be grade using the following scale:
Documentation |
25 points |
||||||||||
Correct Results |
25 points |
||||||||||
Correct Sytle |
25 points |
||||||||||
Other |
|
UMBC CMSC104 |