Programming Assignment #7: Hardware Store Inventory

This programming assignment is described in exercise 11.12 on page 464 of your book. Note that the second sentence in the description should read "Write a program that lets you initialize the file ..."; i.e, your program shouldn't initialize the database everytime you run it. Here is an example run:
> tools
Hardware Store Inventory Program by Alyssa P. Hacker

Type 0 to initialize tool database, 1 to list database, 2 to input
a new tool, 3 to delete a tool, 4 to update a tool's information, and
5 to quit: 1

file not found error while reading tool database.

Type 0 to initialize tool database, 1 to list database, 2 to input
a new tool, 3 to delete a tool, 4 to update a tool's information, and
5 to quit: 0

Initializing the tool database will erase any previous information
you might have stored in the database.  Are you sure you want to do
this?  yes

Tool database initialized.

Type 0 to initialize tool database, 1 to list database, 2 to input
a new tool, 3 to delete a tool, 4 to update a tool's information, and
5 to quit: 1

Record #     Tool Name               Quantity       Cost
--------     ---------               --------       ----

Type 0 to initialize tool database, 1 to list database, 2 to input
a new tool, 3 to delete a tool, 4 to update a tool's information, and
5 to quit: 3

Enter tool record number:  13

No such tool.

Type 0 to initialize tool database, 1 to list database, 2 to input
a new tool, 3 to delete a tool, 4 to update a tool's information, and
5 to quit: 2

Enter new tool number: 3
Enter new tool name:  Electric sander
Enter new tool quantity:  7
Enter new tool cost:  57.98

Type 0 to initialize tool database, 1 to list database, 2 to input
a new tool, 3 to delete a tool, 4 to update a tool's information, and
5 to quit: 1

Record #     Tool Name               Quantity       Cost
--------     ---------               --------       ----
   3         Electric sander            7           57.98

Type 0 to initialize tool database, 1 to list database, 2 to input
a new tool, 3 to delete a tool, 4 to update a tool's information, and
5 to quit: 4

Enter tool number to update: 3
Do you want to change the tool's name?  no
Enter new quantity of Electric sanders:  6
Enter new cost of Electric sanders:  49.95
 
Type 0 to initialize tool database, 1 to list database, 2 to input
a new tool, 3 to delete a tool, 4 to update a tool's information, and
5 to quit: 5

Bye bye.
>
> tools

Type 0 to initialize tool database, 1 to list database, 2 to input
a new tool, 3 to delete a tool, 4 to update a tool's information, and
5 to quit: 1

Record #     Tool Name               Quantity       Cost
--------     ---------               --------       ----
   3         Electric sander            6           49.95 

Type 0 to initialize tool database, 1 to list database, 2 to input
a new tool, 3 to delete a tool, 4 to update a tool's information, and
5 to quit: 5

Bye bye.