created 01/20/99; revised 01/20/00

CHAPTER 20 --- Example Program

This chapter steps you through the creation of a small program that mimics the operation of a combination lock. The goal is for you to gain additional experience in programming, and to review several topics.

The chapter reviews:

  • How to get an integer from the user.
  • The if statement.
  • The boolean data type.
  • The while statement.
There are no new topics in this chapter, so you can skip it if you feel that you need no further practice.

QUESTION 1:

  • How many numbers does the combination lock on your gym locker use?
  • When you dial the combination, does the order of the numbers matter?
  • What is your combination?
  • Is there anything in your locker I can use?

Click Here after you have answered the question