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
9 questions
Повторення пайтон3 панда

Quiz
•
University
10 questions
Python Unit 3

Quiz
•
University
10 questions
Quizizz Python Start one year 1 def and if

Quiz
•
University
10 questions
Unit 10 - Packet Switching

Quiz
•
12th Grade - University
10 questions
Funciones y While Python - TC1028

Quiz
•
University
14 questions
Bill Gates vs Bill Murray

Quiz
•
University
10 questions
Computer Networks Quiz

Quiz
•
University
10 questions
Quiz 6

Quiz
•
University
Popular Resources on Wayground
10 questions
Video Games

Quiz
•
6th - 12th Grade
20 questions
Brand Labels

Quiz
•
5th - 12th Grade
15 questions
Core 4 of Customer Service - Student Edition

Quiz
•
6th - 8th Grade
15 questions
What is Bullying?- Bullying Lesson Series 6-12

Lesson
•
11th Grade
25 questions
Multiplication Facts

Quiz
•
5th Grade
15 questions
Subtracting Integers

Quiz
•
7th Grade
22 questions
Adding Integers

Quiz
•
6th Grade
10 questions
Exploring Digital Citizenship Essentials

Interactive video
•
6th - 10th Grade
Discover more resources for Computers
20 questions
Definite and Indefinite Articles in Spanish (Avancemos)

Quiz
•
8th Grade - University
7 questions
Force and Motion

Interactive video
•
4th Grade - University
36 questions
Unit 5 Key Terms

Quiz
•
11th Grade - University
7 questions
Figurative Language: Idioms, Similes, and Metaphors

Interactive video
•
4th Grade - University
15 questions
Properties of Equality

Quiz
•
8th Grade - University
38 questions
WH - Unit 3 Exam Review*

Quiz
•
10th Grade - University
21 questions
Advise vs. Advice

Quiz
•
6th Grade - University
12 questions
Reading a ruler!

Quiz
•
9th Grade - University