Thursday, February 9, 2012

4.4.3. Length of the string

We can know how many letters a string has, using "myString.Length." This allows us to go through the string, one letter at a time, using loops such as "for".

Suggested exercises:
  • A program to ask for your name and display it on screen separating each letter of the next with a space. For example, if your name is "John", it should display "J o h n". 
  • A program capable of adding two very large integers (eg, 30 digits). These should be entered as strings and analyzed letter by letter. 
  • A program to multiply two large integers (eg, 30 figures), entered as strings and analyzed letter by letter.

No comments:

Post a Comment