touque.ca > Education Commons > Programming: Assignments > Review

Review Assignments

Textbook

  1. Repetition: exercises 6.6, pp. 120–123
  2. Selection: exercises 9.7, pp. 174–176
  3. String: exercises 11.8 pp. 204–207
  4. Text: exercises 12.8, pp. 222–224
  5. Array: exercises 14.11, pp. 255–259
  6. Subprograms: exercises 16.8, pp. 294–296

Strings

Write simple programs to perform the following tasks:

  1. Take single words from the keyboard and echo them to the console in a series of steadily growing lines, with no line longer than 60 characters. Test your program with a number of words sufficient to produce at least three full lines. Sample output:
    • The
    • The rain
    • The rain in
    • The rain in Spain
    • The rain in Spain falls
    • The rain in Spain falls mainly
    • The rain in Spain falls mainly on
    • etc …
  2. Take an entire punctuated sentence from the keyboard and echo it stripped of punctuation.
  3. Take an entire punctuated sentence from the keyboard and echo only the punctuation.
  4. Take an entire punctuated sentence from the keyboard and echo it with a capital letter at the start of each word.
  5. Take an entire punctuated sentence from the keyboard and echo it with a capital letter at the start of each word which has an odd number of letters.
  6. Take an entire punctuated sentence from the keyboard and echo it in reverse order, correctly punctuated.

touque.ca > Education Commons > Programming: Assignments > Review