CS 1160 Midterm Test One Study Guide
Monday, February 29th, 2016

  1. Write a for loop statement to print out the numbers 1 to 20.

  2. What does the acronym SASP stand for? Fill in the four blanks with the four words please.

  3. Page 19 of the textbook, Figure 1-9 of the textbook was also handed out on the first day of class: 1160handout1.pdf ...
    1160handout1.pdf ...
      "The steps listed in Figure 1-9 emphacize the importance of planning.
       Just as there are good ways and bad ways to paint a house, 
       there are good ways and bad ways to create a program.
       A good program always begins with planning."
    

  4. Step #1 of Figure 1-9 is to "Clearly define what the program is to do."

    What are the four things you must identify in this first step, according to the textbook (and page 19 handout)?

  5. Figure 1-9 lists 9 different steps. List the first four steps (of the nine steps).

  6. Arguments passed by value and by reference = Function (II)

    Study pages 47-49 of The C++ Language Tutorial. Understand the different ways for passing arguments to function. INPUT and OUTPUT and INPUT/OUTPUT or IN and OUT and IN/OUT were discussed on 2/22/16 Monday.

  7. From week #1: I P O and why I O first and then P second. See item #8.
    Why does focus on WHAT precede the focus on HOW? What is I? What is O? What is P?
    See LI List Item #8 on week1.html to review IPO and resisting the urge to code.

  8. Figure 5-1: Draw the flow chart for the logic of a while loop. Page 233 of textbook (and handout).

  9. Convert the while loop to a for loop. Convert the for loop to a while loop.

  10. Page 294, Programming Challenge #1 - write the program that can find the sum of the integers 1, 2, 3, ..., n where n is a positive integer that is entered by the user of your program.
    See #5, #6, and #7 for the Solution and more importantly the process of arriving at it.

  11. Print out the numbers 1, 2, 3, 4, ..., 99, 100 by printing exactly 10 numbers per line. Use either a for loop or a while loop to do it.
    See ASCII characters example for 16 per line: Printing 32 thru 47, 48 thru 63, 64 thru 79, ..., 112 thru 127 would be SASP.

    Note: See also the PRIME number program primes3.cpp for another example for how to print 10 numbers per line of output.

  12. ...

  13. ...

  14. ...

  15. ...