This file contains hidden or 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
#Echo Phase 4 | |
class Echo | |
def initialize | |
@comments = [] | |
get_input | |
if @input == "Nothing!" | |
puts "Ok, fine!" | |
elsif @input == "I have a lot to say" |
This file contains hidden or 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
#Echo Phase 3 | |
class Echo | |
def initialize | |
get_input | |
if @input == "Nothing!" | |
puts "Ok, fine!" | |
elsif @input == "I have a lot to say" | |
respond_to_alot |
This file contains hidden or 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
#Echo Phase 2 | |
class Echo | |
def initialize | |
get_input | |
if @input == "Nothing!" | |
puts "Ok, fine!" | |
elsif @input == "I have a lot to say" |
This file contains hidden or 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
#Echo Phase 1 | |
class Echo | |
def initialize | |
get_input | |
play_back(@input) | |
end | |
def get_input |
This file contains hidden or 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
#All I need in life are my favorite movies and an array of hash. | |
favorite_movies = [ | |
{ title: 'The Big Lebowski', year_released: 1998, director: 'Joel Coen', imdb_rating: 8.2 }, | |
{ title: 'The Shining', year_released: 1980, director: 'Stanley Kubrick', imdb_rating: 8.5 }, | |
{ title: 'Troll 2', year_released: 1990, directory: 'Claudio Fragasso', imdb_rating: 2.5 } | |
] | |
favorite_movies.each do |movie| | |
puts "#{movie[:year_released]}: #{movie[:title]}" |
This file contains hidden or 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 './register.rb' | |
require 'pry' | |
cashier = Register.new | |
#Load Inventory List from CSV | |
cashier.load_products("products.csv") | |
#Display Menu | |
#cashier.display_menu |
This file contains hidden or 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
train_times = { 1 => 2, | |
2 => 5, | |
3 => 7.5, | |
4 => 8.5, | |
5 => 9, | |
6 => 10, | |
7 => 11.5, | |
8 => 13.5, | |
9 => 14.5, |
This file contains hidden or 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
salutations = [ | |
'Mr.', | |
'Mrs.', | |
'Mr.', | |
'Dr.', | |
'Ms.' | |
] | |
first_names = [ |
This file contains hidden or 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
#Cashier | |
require './register.rb' | |
puts "Welcome to James' Coffee Emporium!" | |
puts "1) Add item - $5.00 - Light Bag " | |
puts "2) Add item - $7.50 - Medium Bag" |
This file contains hidden or 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
#List Statistics by Van | |
require './statistics.rb' | |
mathmatician = Statistics.new | |
mathmatician.read_file | |
puts "" | |
mathmatician.report_average_score | |
mathmatician.report_highest_score | |
mathmatician.report_lowest_score |