Monday, April 30, 2007

 

POSTPONED TO NEXT WEEK - Test on Turing, Ch.11 will be first class next week

Because of conflicts with a music field trip, the programming test on Chapter 11 (Handling Strings) is re-scheduled to the first class of next week.

As usual, the questions will be modeled on the questions at the end of the chapter (excluding those we've labeled as "Optional. For students wanting a challenge") and the questions in the "Extra Exercises" file.

Next week we will continue into Chapter 12 of the Turing textbook.

Sunday, April 29, 2007

 

Practise string handling with real text

As you practise handling strings in Turing, it's more fun to use "real" text. One great source of full-length books in ASCII format is www.gutenberg.org.
Now that you know how to access external files with your programs (Ch. 10), you can write programs to analyze a famous book and calculate what percentage is vowels, find the average length of a sentence, find the longest word, encrypt the text by replacing characters - all kinds of interesting things.

(Amaze your English teacher by announcing you know the exact number of times the words "love" and "hate" appear in Romeo and Juliet. Yowzah! Replace every other word in the whole book with your name and see if it is still readable. Change all the i's to 1s, the b's to 6s, the e's to 3s, the s's to 5s. Go crazy.)

Remember that the text should not contain any quotation marks, since Turing will interpret them as signs for tokens. Before you use the text, do a quick Search and Replace in Notepad to replace all the quotation marks (") with apostrophes (').

This page is powered by Blogger. Isn't yours?