- Use a full sheet of 8½ x 11" paper. (Half sheet? Half credit!)
- Put your last name and first initial in the far upper left hand corner!
- No need to write out questions.
- Numbering responses may help you avoid overlooking a question; it's ok to go ahead and pre-number your sheet.
- Time: 3'30"; four questions
- Can everybody see this line?
Quiz 10; November 14; 3'30"; 1+1+1+3 pts + 1 pt EC
- What is Ruby's counterpart for Python's
list
class?
- What is a notable difference between strings in Ruby and strings in Java?
- What is the value of the following Ruby expression?
"abc"[10]
- Write a Ruby program that prompts the user with
"Line?"
,
reads one line, and then prints the length of the line and the line's
first character. Example:
% ruby q10.rb
Line?
testing (typed by user)
7 chars; first is t.
%
EC (1pt): Write a Ruby question and answer it.