Term
What two categories of numbers does Ruby work with? |
|
Definition
Integers and Floating Point |
|
|
Term
How do you raise 2 to the second power? |
|
Definition
|
|
Term
what are the two subclasses for integers? |
|
Definition
|
|
Term
How do you determine what type of number you are using? |
|
Definition
the number with .class at the end |
|
|
Term
What method rounds a floating point? |
|
Definition
|
|
Term
What method converts a float to an integer? |
|
Definition
|
|
Term
|
Definition
|
|
Term
What method will force a float to be rounded up? |
|
Definition
|
|
Term
How do you make the same string appear multiple times? |
|
Definition
|
|
Term
What are advantages of using double quoted strings? |
|
Definition
they evaluate backslashes so you can use both variables and special characters such as \t. |
|
|
Term
What method displays the characters of a string in reverse? |
|
Definition
|
|
Term
What method capitalizes a string? |
|
Definition
|
|
Term
What method presents a string in all lower case letters? |
|
Definition
|
|
Term
What method displays all characters in a string in upper case letters? |
|
Definition
|
|
Term
What method tells you how many characters are in a string? |
|
Definition
|
|
Term
What is the append operator that is used to add an element to the end of an array? |
|
Definition
|
|
Term
How do you substitute a null value to the first index of an array called data_set? |
|
Definition
|
|
Term
What method returns the contents of an array and its structure? |
|
Definition
|
|
Term
What method puts all of the elements of an array into a string? |
|
Definition
|
|
Term
How would you return the contents of an array as characters separated by a comma? |
|
Definition
|
|
Term
How would you take the string x = "b,4,5,a,8" and make it an array called y that would have this structure: ["b", "4", "5", "a", "8"] ? |
|
Definition
|
|
Term
What method reverses the order of an element? |
|
Definition
|
|
Term
What method will sort an array of numbers? |
|
Definition
|
|
Term
What method will return an array of only unique values? |
|
Definition
|
|
Term
What method will delete the element at the second position in an array? |
|
Definition
|
|
Term
How do you delete a certain value in an array? |
|
Definition
|
|
Term
What is another way to add an element to an array other than < |
|
Definition
|
|
Term
What method will remove the last element of an array for you? |
|
Definition
|
|
Term
What method will remove the first element from an array? |
|
Definition
|
|
Term
How would you undo a .shift method performed on an array? |
|
Definition
|
|
Term
How do you enclose a hash? |
|
Definition
|
|
Term
How do you point a key to a value in a hash? |
|
Definition
|
|
Term
What method do you use to find a key for a value? |
|
Definition
|
|
Term
What method will display all the keys of a hash? |
|
Definition
|
|
Term
What method will display all the values of a hash? |
|
Definition
|
|
Term
What method will show you how many values are in a hash? |
|
Definition
|
|
Term
What method will remove all the contents of a hash? |
|
Definition
|
|
Term
What method will convert all the key value pairs into arrays? |
|
Definition
|
|
Term
What is the equals operator? |
|
Definition
|
|
Term
|
Definition
|
|
Term
How do you determine if 2 is in between the values 1 and 4 using the .between method? |
|
Definition
|
|
Term
What method would you use to determine of a key with the value of a is in a hash? |
|
Definition
|
|
Term
How would you display the contents of a range of numbers 1- 10 inclusive? |
|
Definition
|
|
Term
How do you show the first number in a range? |
|
Definition
|
|
Term
How do you show the last number of either an exclusive or inclusive range? |
|
Definition
|
|
Term
How do you determine if a range includes the number 5? |
|
Definition
range_of_numbers.inlude?(5) |
|
|
Term
How do you return the values of a range "x" as an array to z? |
|
Definition
|
|
Term
What command terminates a whole loop? |
|
Definition
|
|
Term
What command moves processing to the next loop? |
|
Definition
|
|
Term
What command causes the loop to redo itself? |
|
Definition
|
|
Term
What command starts the whole loop over? |
|
Definition
|
|
Term
how do you begin a do loop? |
|
Definition
|
|
Term
How would you iterate 1 through five and print "Hello" to the screen? |
|
Definition
|
|
Term
How would you iterate counting down to 1 and print "Hello" to the screen? |
|
Definition
5.downto(1){puts "Hello"} |
|
|
Term
How would you iterate through a range of 1 to 5 and print "Hello" to the screen each time? |
|
Definition
(1..5).each{puts "Hello"} |
|
|
Term
How do you end an if...else statement? |
|
Definition
|
|
Term
How do you use the ternary operator to determine if "x" is equal to one and return yes if it is and no if it isn't? |
|
Definition
puts x == 1 ? "yes" : "no" |
|
|
Term
What is the syntax for a global variable? |
|
Definition
|
|
Term
What is the syntax for a class variable? |
|
Definition
|
|
Term
What is the syntax for an instance variable? |
|
Definition
|
|
Term
What is the syntax for a local variable? |
|
Definition
|
|
Term
What is the syntax for a block variable? |
|
Definition
|
|