This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Find all time entries. | |
SELECT * | |
FROM time_entries; | |
# Results Returned: 500 | |
Find the developer who joined the company most recently. | |
SELECT * | |
FROM developers | |
ORDER BY joined_on DESC |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'minitest/autorun' | |
require 'minitest/pride' | |
# Write a method which returns: | |
# | |
# * "Fizz" if the number is divisible by 3 | |
# * "Buzz" if the number is divisible by 5 | |
# * "FizzBuzz" if the number is divisible by 3 and 5 | |
# * Otherwise, return the number itself | |
# |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#WARNING! This code is functional but has some redundancy | |
#LEVEL: NIGHTMARE | |
def is_a_number(input) | |
true if Float(input) rescue false | |
end | |
def get_input() | |
puts "Please give me your input:" | |
gets.chomp |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#Compares weight of 2 items | |
def weigh(item1, item2) | |
$totalWeighings += 1 | |
if item1 > item2 | |
return 0 | |
elsif item2 > item1 | |
return 1 | |
else | |
return 2 | |
end |
NewerOlder