“Typing is no substitute for Thinking.”
Handout: 1_Intro_1_strings.pdf
Training mission
Click on the student template. The teacher will help us fill it out.
A string is a sequence of zero or more characters surrounded by quotes, e.g.,
string
“Washington”
“134”
“david34”
“Today is a great day!”
” ”
“”
comment
an alphabetic string (only letters)
a numeric string (only numbers)
an alpha-numeric string (only letters and numbers)
a general string
a string of spaces
the empty string (nothing in it)
Advanced (show me): Most characters that we use in strings are visible, like letters, digits, and punctuation marks. However, strings can also contain invisible characters. The most common invisible characters are:
- the space, created with the space bar; it leaves a blank before writing the next character.
- the new line, created typing \n; writes the next character on the next line
- the tab, created typing \t; jumps to the next fix column position
3rd grade – It’s all about me
Please tell us a bit about yourself by filling the strings. The following is
a sample for another student:
Hello
My name is Anakin. I am 10 years old and am in 10 grade,
in Obi-Wan’s class, at the Jedi Temple.My favorite food is black beans and rice and my favorite
ice cream flavor is cookie dough.
Answer: Show it to me
4th grade – Scrambled secret message
Here is a scrambled message. Our best decoder came up with the following message:
r thig is nking.no subte fostituTypin
but somehow we do not think he got it right because it does not make sense.. it is not even English! Please, help us recover the message correctly
Hint: look at the quote at the top of this webpage.
Answer: Show it to me
5th grade – Robotics section cafeteria
We hired a programmer to write our menu but unfortunately he is presently at the hospital with food poisoning. We are hoping you can finish the program that he started. At the moment all we have is this:
and.. well.. everybody is sick and tired of only burger and fries. Please, please… would you finish the menu? With the items in alphabetical order, please?
Answer: Show it to me
Kudos if were able to use the ‘\t’ character, a.k.a. a ‘tab’, to align the items vertically.
6th grade – The pair-up game
Hum.. Megatron is the robot from Star Wars.. or is it from Star Trek? I can’t remember… I need help!
Finish the list of famous robots paired up with the T.V. show or movie in which they appeared. So far this is what we have:
Are we missing any? Add any pair that you can think of.
Answer: Show it to me
Kudos if you are able to align the columns vertically