CPSC 120 LAB 10 | Back to Lab index page |
Lab must be completed and reviewed by Peer Instructor Seth Peery no later than Fri, Nov 2 during lab class.
You are to write a nicely documented Ada program that sets up a record data type that is intended to hold the following information: the part number, a descriptive name for the part, the quantity in inventory, and the price of the part. The part number should be a field that is limited to the integers 1..10, the descriptive name will be a string of 30 characters or less, the quantity on hand will never be greater than 1000 parts, and the price will be between $1.00 and $10.00. The program should then prompt the user to enter this information for one part number, this should be implemented in a procedure with exception handling. The program should utilize a function to calculate the value of the inventory of this part number, (multiply the price by the quantity in inventory).
Sample input output --
Program outputs: | Enter a part number (0-10)> |
User inputs: | 9 |
Program outputs: | Enter a description for the part (30 characters exactly)> |
User inputs: | 2 lb. Steel head, claw, hammer |
Program outputs: | Enter the quantity in inventory(0..1000)> |
User inputs: | 50 |
Program outputs: | Enter the price for this part> |
User inputs: | 2.50 |
Program outputs: | The value of the inventory of part 9 ( 2 lb. Steel head, claw, hammer) is $125.00. |