Chapter 6 Outcomes
The Elements of Programming: Repetition


After completing this chapter and participating in class, you should be able to accomplish each of the following outcomes.

Knowledge Outcomes

  1. Define each of the key terms listed in the chart below.

  2. control structure linear sequence repetition
    selection loop & end loop problem specification
    body of the loop lower case upper case
    case sensitive round off round
    testing of a program test values correctness of program
    program bug debugging formatting of output
    field size right justified left justified
    table of results decimal place exit when
    sentinel end-of-file value conditional loop
    simple condition comparison operator compound condition
    logical operator and or
    not counter accumulator

  3. List the 3 types of control structures that are common to all programming languages.

  4. Identify the instructions which comprise the body of a loop.

  5. State the special keystroke sequence which stops the execution of an endless (infinite) loop.

  6. Explain how the "costplus" program operates by performing a walk through.

  7. Explain why Turing is considered to be a case sensitive programming language.

  8. Discuss why the first letter of the second word is capitalized in a 2-word variable name (eg. taxRate).

  9. Explain why intermediate variables are used when writing more complex programs.

  10. List and describe 3 methods that can be used when testing a program.

  11. When using line formatting in a put statement, state the justification rule for both strings and numbers in a field.

  12. Explain the purpose of the number following the first colon (:), and the purpose of the number following the second colon (eg. taxRate:10:2).

  13. Explain the main difference between a conditional loop and an endless loop. Be sure to describe what the term condition refers to.

  14. Describe the two types of end-of-file (eof) values that can be used to stop the execution of a loop.

  15. Explain the difference between a simple condition and a compound condition.

  16. State the 6 comparison operators, showing how they are written.

  17. Explain why both sides of a comparison must be of the same data type.

  18. Describe the logic which the computer will follow when an or compound condition is used.

  19. Describe the logic which the computer will follow when an and compound condition is used.

  20. Describe the logic which the computer will follow when a not compound condition is used.

Skills Outcomes

  1. Use the loop and end loop repetition structures to cause a series of statements to be repeated.

  2. Output words or numbers into a table format.

  3. Line up decimal numbers when they are being output, one under another.

  4. Take a line which has formatting codes built in and show exactly how the line would appear when it is executed by the computer.

  5. Using an exit when statement and a sentinel value, stop the execution of a loop (eg. exit when cost < 0).

  6. Write compound conditionals using the logical operators and and or.

  7. Create a counter, and describe its purpose in a program.

  8. Create an accumulator, and describe its purpose in a program.

  9. Demonstrate how to make a counted loop increment by numbers other than one. As well, be able to start a count sequence at any number and stop the count sequence at any number.

  10. Detect and correct a variety of common errors as outlined in the chapter.