The Ruby Erudite Saga Quiz

Quiz
•
Computers
•
University
•
Hard
Lorenah Mbogo
Used 4+ times
FREE Resource
9 questions
Show all answers
1.
FILL IN THE BLANK QUESTION
1 min • 10 pts
What does this expression evaluate to?
"Cool".+("io")
Answer explanation
This is another way to concatenate Strings. The previous example actually uses syntactic sugar (a deviation from formal syntax to enhance code readability) and this example uses the strict syntax.
2.
FILL IN THE BLANK QUESTION
1 min • 10 pts
What does this expression print?
my_name = "50 Cent"
my_name = "Miley"
p my_name
Answer explanation
The my_name variable was assigned to the value "50 Cent", but then it was reassigned to the value "Miley". Once the my_name variable is reassigned to "Miley", it loses all knowledge that it used to point to "50 Cent".
3.
FILL IN THE BLANK QUESTION
3 mins • 12 pts
Define a method called silly_check() that takes a number argument and returns "The number is less than 5" if the argument is less than 5 and "The number is greater than or equal to 5" otherwise.
4.
MULTIPLE CHOICE QUESTION
1 min • 10 pts
name = "clem"
age = 32
Is this array valid?
[name, age]
Yes
No
Answer explanation
Yes, variables can be used inside of Arrays.
5.
MULTIPLE CHOICE QUESTION
1 min • 10 pts
Which of the following is the correct way to define a class called Car?
def Car/end
class Car/end
create Car/end
6.
MULTIPLE CHOICE QUESTION
1 min • 10 pts
What is an instance variable?
A variable that describes an attribute of an instance of a class and is available to all instance methods of a class.
A variable that describes an attribute of an instance of a class and is available to both instance and class methods within a class.
7.
FILL IN THE BLANK QUESTION
3 mins • 12 pts
What does the following expression print?
if "sam" == "cat"
puts "sam equals cat"
elsif "matt" == "matt"
puts "matt equals matt"
else puts "whatever"
end
Answer explanation
The elsif keyword is used to add additional logical criteria to an if statement and this expression prints "matt equals matt". In this case, the boolean condition following the if statement ("sam" == "cat") evaluates to false, so the code inside the if block is not executed. However, the boolean condition following the elsif statement evaluates to true ("matt" == "matt"), so the code inside the elsif block is executed.
9.
FILL IN THE BLANK QUESTION
3 mins • 14 pts
Consider the following table and SQL query:
What will the SQL query above return?
Similar Resources on Wayground
12 questions
UML-2020-158225-Week7-ClassDiagramObjectDiagram-NTY

Quiz
•
University
10 questions
Quizizz Tổng hợp kiến thức

Quiz
•
5th Grade - University
10 questions
DBMS Quiz1

Quiz
•
University - Professi...
11 questions
По коду Minecraft

Quiz
•
University
10 questions
Understanding Procedures in Python

Quiz
•
9th Grade - University
13 questions
Quiz1_PBO_B_C

Quiz
•
University
10 questions
Q4 - Comp Vision

Quiz
•
University
10 questions
AITT LAB QUIZ 4

Quiz
•
University
Popular Resources on Wayground
50 questions
Trivia 7/25

Quiz
•
12th Grade
11 questions
Standard Response Protocol

Quiz
•
6th - 8th Grade
11 questions
Negative Exponents

Quiz
•
7th - 8th Grade
12 questions
Exponent Expressions

Quiz
•
6th Grade
4 questions
Exit Ticket 7/29

Quiz
•
8th Grade
20 questions
Subject-Verb Agreement

Quiz
•
9th Grade
20 questions
One Step Equations All Operations

Quiz
•
6th - 7th Grade
18 questions
"A Quilt of a Country"

Quiz
•
9th Grade