Skip to content

Instantly share code, notes, and snippets.

View mikedao's full-sized avatar
🤷

Michael Dao mikedao

🤷
View GitHub Profile

Truthy and Falsey

In computing, we have boolean values. We expect there to be a true and there to be a false.

It lets us do things like this:

a = true

if a == true

Time to practice. I'm going to give you two arrays.

  chocolate = ["Ritual",
                "Chuao",
                "Chocolove",
                "Scharffen Berger"]
  peanut_butter = ["Peter Pan",
                    "Skippy",
                    "Justin's",

Justin: Who is Roy Fielding, baby?

Selena: Some guy. He’s smart.

Justin: Oh? What did he do?

Selena: He helped write the first web servers and then did a ton of research explaining why the web works the way it does. His name is on the specification for the protocol that is used to get pages from servers to your browser.

Justin: How does it work?

  • What do you know about modules already? If little, what would you guess modules are all about?
  • Golf and basketball both use a ball. But if you're on a basketball court and ask for "the ball," no one is going to throw you a golf ball. Why? If you were as dumb as a computer, why would a golfd ball be an acceptable response?
  • You've learned about the object model and method lookups. What would the imapct be of injecting an additional ancestor into a class' lookup chain?
* Create a student.
* They should have a name.
* They should have a house.
* They should have a method called #name that prints to screen, "Hello, my name is name and I'm in house"
* They should have a method that returns (your choice of spell"
* Add a method called get_points that adds a number of points as an argument.
* Add a method called points that tells us how many points the student has.

Enums Homework Part 1

Do by April 4.

git clone http://github.com/turingschool/enums-exercises

Do the following in order:

Exercises

  • If you had an array of numbers, e.g. [1,2,3,4], how do you print out the doubles of each number? Triples?
  • If you had the same array, how would you only print out the even numbers? What about the odd numbers?
  • How could you create a new array which contains each number multipled by 2?
  • Given an array of first and last names, e.g. ["Alice Smith", "Bob Evans", "Roy Rogers"], how would you print out the full names line by line?
  • How would you print out only the first name?

Anchor

  • Project Schedule
  • Session Assignment / Google Calendar
  • 1 on 1s
  • Full Group Classes
  • Portfolio Rubric
  • Scope and Sequence
  • Portfolio Promotion Decision
  • Assessment Content / Design
  • Revising Lessons
id first_name last_name phone_number age
1 taylor swift 5555555 25
2 jeff wan 2222222 35
3 luna lovegood 3333333 17
diff --git a/lib/district.rb b/lib/district.rb
new file mode 100644
index 0000000..ebe98f8
--- /dev/null
+++ b/lib/district.rb
@@ -0,0 +1,10 @@
+class District
+ attr_reader :name
+
+ attr_accessor :enrollment