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
| class Patient | |
| attr_reader :name | |
| attr_accessor :room | |
| attr_accessor :id | |
| # attr_reader :room | |
| # attr_writer :room | |
| # to assign initial values to the patient instance when we create | |
| def initialize(attributes = {}) |
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
| # TODO: you can build your horse race program here! | |
| # 1. Create a list of horses taking part in the race (an array to store horse names) | |
| # e.g ["bob", "racing stripes", "happy feet"] | |
| # 2. Define the balance (amount of money that they have on them) the user has | |
| # e.g 1000 | |
| # 3. Display the horse names with their running number to the user (puts) | |
| # e.g 1. bob | |
| # 2. racing stripes |
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
| def calculate(num1, num2, operator) | |
| # if operator == "+" | |
| # return num1 + num2 | |
| # elsif operator == "-" | |
| # return num1 - num2 | |
| # elsif operator == "/" | |
| # return num1 / num2 | |
| # elsif operator == "*" | |
| # return num1 * num2 |
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
| # TODO: you can build your instacart program here! | |
| # NOTE: we will not worry about the quantity of same item the user wants to buy | |
| # Just assume the user will only buy one of an item | |
| # 1. Greet the user | |
| # 2. Define a list of items being sold e.g milk 1, bread 2, jam 5 | |
| # Note that we need to store the name of the item and the price of the item (Hash) | |
| # 3. Create an empty shopping basket for the user (Array) | |
| # 4. Need to display the items and their prices on sale at the store |
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
| class Animal | |
| def name(name) | |
| # self -> #<Animal:0x00007fccb4048ea8> | |
| @name = name | |
| # TODO: what should this method return? | |
| # self -> #<Animal:0x00007fccb4048ea8 @name="max"> | |
| self | |
| end | |
| def species(species) |
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
| class Restaurant | |
| # TODO: add relevant accessors if necessary | |
| attr_reader :average_rating, :city | |
| def initialize(city, name) | |
| # TODO: implement constructor with relevant instance variables | |
| @city = city | |
| @name = name | |
| @sum_of_all_rating = 0 | |
| @num_of_ratings = 0 |
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
| RSpec::Support.require_rspec_core 'formatters/base_text_formatter' | |
| class BonusFormatter < RSpec::Core::Formatters::DocumentationFormatter | |
| RSpec::Core::Formatters.register self, :dump_summary | |
| def dump_summary(notification) | |
| output.puts BONUS if notification.failure_count.zero? | |
| super notification | |
| end | |
| end |
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
| <html> | |
| <head> | |
| <meta charset="utf-8"> | |
| <title>Bootstrap demo</title> | |
| <!-- Need to read device screen width (Bootstrap) --> | |
| <meta http-equiv="X-UA-Compatible" content="IE=edge"> | |
| <meta name="viewport" content="width=device-width, initial-scale=1"> |
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
| <html> | |
| <head> | |
| <meta charset="utf-8"> | |
| <title>Bootstrap demo</title> | |
| <!-- Need to read device screen width (Bootstrap) --> | |
| <meta http-equiv="X-UA-Compatible" content="IE=edge"> | |
| <meta name="viewport" content="width=device-width, initial-scale=1"> |
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
| gistup |
NewerOlder