touque.ca > Education Commons > Programming: Assignments > Review
Review Assignments
Textbook
- Repetition: exercises 6.6, pp. 120–123
- Selection: exercises 9.7, pp. 174–176
- String: exercises 11.8 pp. 204–207
- Text: exercises 12.8, pp. 222–224
- Array: exercises 14.11, pp. 255–259
- Subprograms: exercises 16.8, pp. 294–296
Strings
Write simple programs to perform the following tasks:
- 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 …
- Take an entire punctuated sentence from the keyboard and echo it stripped of punctuation.
- Take an entire punctuated sentence from the keyboard and echo only the punctuation.
- Take an entire punctuated sentence from the keyboard and echo it with a capital letter at the start of each word.
- 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.
- Take an entire punctuated sentence from the keyboard and echo it in reverse order, correctly punctuated.
touque.ca > Education Commons > Programming: Assignments > Review
© 2007–2014 Hersch, Bear & Company Limited. All rights reserved. “touque.ca,” “Canada’s Thinking Cap,” “Grammar Authority,” and “grammarauthority.com,” are trademarks of Hersch, Bear & Company Limited. All other trademarks and copyrights are the property of their respective owners. | Privacy Policy | Licence to Copy | How to cite | Contact us