???
?: Which command outputs a String
with a newline character?
( ) p
(X) puts
( ) \n
( ) prints
?: Which command outputs a String
with a return value?
( ) puts
(X) p
( ) print
( ) pp
?: Which character creates a comment in Ruby?
(X) #
( ) $
( ) //
( ) /*
?: In the terminal, which key combination interrupts looping code?
(X) ctrl+c
( ) ctrl+x
( ) ctrl+z
( ) ctrl+b
?: What does the code snippet below evaluate to?
count = 0
while count < 3 do
puts "#{count}"
count = count + 1
end
( ) 1 2 3 ( ) Infinite Loop ( ) 0 1 2 3 (X) 0 1 2
?: What does the code snippet below evaluate to?
temperature = 70
if temperature <= 50
puts "Bundle up!"
elsif (temperature > 50 && temperature < 70)
puts "Hoodie weather!"
else
puts "It's a scorcher!"
end
( ) Bundle up! (X) Itβs a scorcher! ( ) Hoodie weather! ( ) Infinite Loop
?: What does the nil
value mean?
(X) No Value ( ) Empty/Blank ( ) Error ( ) 0
?: Which of these are a core category of code statements?
( ) Sequence ( ) Selection ( ) Repetition (X) All of the above.
?: What statement can be used to break out of a loop?
( ) exit
(X) break
( ) end
( ) return
?: A case statement is an alternative statement to if...elsif...elsif...end
(X) TRUE ( ) FALSE
???