Thursday, April 29, 2010

String Handling Part 2



Program Example 15 is also similar to a program we wrote in QBasic - the Sentence one. It counts the number of spaces to work out the number of words in a sentence. It also uses an array to keep track of how times each letter occurs in the sentence. New string functions are CHR and ASC.





Questions to answer:



  1. What is a pangram?
  2. What is ASCII?
  3. Explain what CHR and ASC do and give some examples.
  4. What is the significance of the ranges 65-90 and 97-122 in the comments of the blue-book-code?
  5. Explain what the AddToArray subroutine does from the time it is called until it ends. You may find it helpful to your understanding to sketch the Letters array.

No comments: