Notes

This task is best preceded by a follow-me activity geared towards producing this result in incremental stages.

Students respond to key questions with their own code and then share ideas as the code is built.

Start with , then y, and then to use for further processing.

  • printing items in the array
  • searching for an item in the arra
  • grabbing the index of an item in the array
  • replacing an item in the array

Discuss the difference between including the code at line 13 or 19.

The Tool Shelf

A carpentry business needs a computer program to track the availability of tools in the workshop.

There is only one toolshelf available and many carpenters.

A Carpenter can:

  • borrow a tool if it is available
  • return a tool to the toolshelf

A Carpenter cannot:

  • borrow a tool that has not been returned
  • borrow a tool that does not exist

Case Study

A software house has taken on this job.

A computer program has already been written to manage this scenario.

It is modular in nature, allowing 3 different programmers to work on it at once, saving time.

As each module was designed, it was tested. It was then integrated into the final program.

Once every module had been integrated into the program, the program was fully tested by the development team.

The intention is to invite some representatives of the carpentry business to test out the product and give some feedback.

If the representatives are happy with it, it can then be fully installed/implemented at the carpentry business's office.

Here is a copy of the code.

Task 1

Open the worksheet and follow the instructions.

Testing and validation

Are there any opportunities to include validation checks in these coding assignments?

Make sure you test your code with a variety of data to make sure it works as expected.