We will have more books soon. Here are the pages from the book you need to complete the Chapter 5 - Part A - Loops Guide.

Are you looking for the projects you need to complete at the end of this part of the chapter? You need the Program List for Chapter 5 - Part A.

Chapter 5 - Part A - Loops

BowerPower

Do...Loop

  1. Look at these two examples of Do...Loops - the first is a Do...Until loop example and the second is a Do...While loop example.
  2. Read pages 129-130. Beware infinite loops! If you've ever had a computer program "freeze" on you, it is possible it got caught in an infinite loop.
  3. Make the Prime Number program on pages 131-132. This loop in this program keeps going as long as the remainder of the division process isn't 0. Once the remainder is 0, the loop stops.

Input Box

  1. Look at this example of using an InputBox.
  2. Read about input boxes on pages 132-133. You've already learned how to use Val( ).

BowerPower

Accumulator Variables

  1. Read page 133 to learn how to keep a running total.
  2. You may have learned how to do this in the previous chapter. Look at this example from Chapter 4 of Keeping A Running Total to see how you can keep a running total throughout a program (in this instance it is a total number of doughnuts).
  3. The Average Score program on page 134 has been started for you. Download it here and refer to pages 134-136 to complete the program.
  4. The Unique Random Numbers program on page 136 has been started for you. Download it here and write the code for the program. You may want to follow these steps:
    1. Get three random numbers (from 1 to some number) to appear in the three labels.
    2. Implement an input box for users to pick the highest possible random number.
    3. Put the process of obtaining the random numbers in a loop from which there is no escape until the three numbers are different.
    4. Place a counter variable in the loop so you can count how many times the loop has to run until you get three unique numbers.

BowerPower

For...Next

  1. Look at this example of using a For...Next loop.
  2. Read page 136. We'll come back to page 137 later.
  3. Make the Factorial program on pages 137-138. Factorials work like this...
    6! = 6 * 5 * 4 * 3 * 2 * 1
    In this program, the math will actually be done like this...
    6! = 1 * 2 * 3 * 4 * 5 * 6
  4. Unless you tell it otherwise, a For...Next loop will count up by +1. What if you want to count by +3? What if you want to count backwards (-1)? Read the top of page 137 to see how we can use Step to make For...Next loops count by something other than +1.
  5. Create the Odd Numbers Sum program described on page 138 (you will need a For.. Next loop that uses Step).

You're ready for the Chapter 5 - Part A Program List!

Ch 05 News

Mr. Bower will be updating this page (you can see that it is incomplete, but ready for the start of the chapter)

Countdown to Pi Day!

Pi Day Countdown

Contact Mr. Bower

Phone:
260.356.6104 x1121

E-mail:
(combine Parts 1 and 2 with the "@" symbol)
Part 1: sbower
Part 2: hccsc.k12.in.us