Construction workers

 

Construction workers need tools to work. The available tools are:

  1. hammer
  2. brush
  3. screwdriver
  4. glue gun
  5. pliers

A program is required to track tools borrowed by a worker in one week.

When a worker borrows a tool, (s)he has to enter the type of tool into a computer program.

The tool will be stored, along with all of the other tools that have been used by the worker in that week.

A worker can borrow a maximum of 10 tools per week. Here is a sample set of data for 1 week:

["hammer", "glue gun", "tape measure", "hammer", "brush", "brush", "pliers", "brush"]

Design a menu-driven program that will allow a user to do the following:

  1. Borrow a tool - this allows the user to enter a valid tool into the system, as long as the number of tools borrowed is less than 10. The weekly data is displayed after entering data.
  2. Count a tool - this allows the user to enter a tool name and the number of times the tool has been borrowed will be displayed.
  3. Quit the program

Testing

Make sure you are thoughtful when testing your solution.

If your code has a validation check, test your code with acceptable/valid data and unacceptable/invalid data.