-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathqanda.rb
39 lines (38 loc) · 2.96 KB
/
qanda.rb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
Q_ARR = [
"After installing the gem 'colorize', how do we use it in an app?\n",
"How would I import a file 'Dog.rb' into a file?\n",
"coder = {teacher: 'Garret', dev: 'Ragan'} \n How would I display the value 'Garret'?\n",
"for i in 1...10\n puts 'I've been printed #"+"{i} times'\nend \n \nWhat will be the last thing printed to the screen?\n",
"days_of_week = ['Tunezday', 'Wednesday', 'Friyay', 'Funday']\n \n days_of_week.each do |day|\n p 'Woohoo' if day == 'Friyay'\n p 'Boo' if day == 'Monday'\nend\nWhat will the previous code snippet output to the terminal?\n",
"Which of the following is the opposite of an if/else statement?\n",
"puts 123 > 321 ? '123 is the bigger number' : '321 is the bigger number'\nWhat will the previous statement output?\n",
"What does DRY stand for?\n",
"How do you add a number to the START of an existing array? arr=[1,2,3]\n",
"What is one way we can install the 'colorize' gem through the terminal?\n",
"In the terminal, how do I view all gems I have installed?\n",
"What will the following code snippet return?\n(3>3) || (4 >= 4 && 'five')\n",
"What will the following code snippet return?\nputs 'Good morning' unless afternoon\n",
"What type of programming language is Ruby?\n",
"In ruby, what is a class?\n",
"In ruby, what keyword do we use to define a class?\n",
"In ruby, what method is called as soon as we create a new instance of a class?\n"
]
A_ARR = [
[1, "require 'colorize'", "require_relative 'colorize'", "add 'colorize'", "new gem 'colorize'"],
[2, "require_relative './classes/Dog.rb", "require_relative './Dog.rb", "require './Dog.rb'", "add 'Dog.rb'"],
[4, "p coder['Garret']", "p coder[teacher:]", "p coder[:dev]", "p coder[:teacher]"],
[1, "I've been printed 9 times", "I've been printed 10 times", "It will display an error", "It will be an infinite loop"],
[3, "WoohooBoo", "Nothing", "Woohoo", "Boo"],
[3, "Ternary Operators", "Case Statement", "Unless Statement", "If/Elsif/Else statement"],
[4, "123", "321", "123 is the bigger number", "321 is the bigger number"],
[4, "Don't Rely on Yourself","Do Rinse Yourself","Do Repeat Yourself","Don't Repeat Yourself"],
[1, "arr.unshift 4", "arr.shift 4", "arr << 4", "arr.append 4"],
[1, "gem install colorize", "new gem colorize", "add colorize", "install gem colorize"],
[4, "gemlists", "list gems", "show gems", "gem list"],
[2, "Error", "true", "seven", "false"],
[3, "'Good morning'", "nil", "It will return an error", "afternoon"],
[3, "Procedural Programming Language", "Functional Programming Language", "Object-Orientated Programming Language", "Logic Programming Language"],
[1, "A blueprint for objects", "A collection of individuals learning similar topics", "An instance of an object", "A terrifying topic that I'll never understand"],
[2, "Class", "class", "new.class", "class.new"],
[2, "No method is called", "initialize", "initialise", "All methods are called"]
]