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
# OOP Fundamentals I: Assignment 4 | |
class Card | |
def initialize(rank, suit) | |
@suit = suit | |
@rank = rank | |
end | |
def rank | |
@rank |
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
# OOP Fundamentals I: Assignment 5 | |
class Whiteboard | |
attr_accessor :contents | |
def initialize(contents = []) | |
@contents = contents | |
end | |
def erase |
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
# OOP Fundamentals I: Assignment 6 | |
class DryEraseMarker | |
attr_reader :color, :capacity | |
def initialize(color) | |
@color = color | |
@capacity = 100 | |
end | |
INK_USE_PER_CHARACTER = 0.01 |
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
# Implement your solution here. You may reference any additional files from here as well. | |
require 'pry' | |
winners = [] | |
while true | |
puts "What was Team 1's name? " | |
team1 = gets.chomp |
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 'csv' | |
require 'table_print' | |
require 'pry' | |
# require_relative 'grade_reader' | |
# require_relative 'student' | |
# require_relative 'assignment_grade' | |
# require_relative 'grade_summary' | |
# ************************************************************* | |
# CLASSES |
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 'csv' | |
require 'pry' | |
class Student | |
attr_reader :name, :score | |
def initialize(name, score) | |
@name = name | |
@score = score | |
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
class Circle | |
def initialize(radius) | |
@radius = radius | |
end | |
def diameter | |
@radius * 2 | |
end | |
def circumference |
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 'csv' | |
# contents of home_info.csv: | |
# Address,Property Value,Selling Price,Down Payment | |
# 43 Fenmore Lane,439000,419000,20000 | |
# 58 Johnson Way,512000,524000,105000 | |
# 32 Silver Lane,485000,490000,97000 | |
# 45 Fenway Drive,465000,460000,93000 | |
# 54 Denise Drive,445000,450000,98000 |
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
#!/usr/bin/env ruby | |
# encoding: UTF-8 | |
SUITS = ['♠', '♣', '♥', '♦'] | |
VALUES = ['2', '3', '4', '5', '6', '7', '8', '9', '10', 'J', 'Q', 'K', 'A'] | |
# *********************************************************** | |
# CLASSES | |
# *********************************************************** |
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
citizens = [ | |
{ | |
first_name: 'Johnny', | |
last_name: 'Smith', | |
annual_income: 120000, | |
tax_paid: 28000 | |
}, | |
{ | |
first_name: 'Liz', |