Skip to content

Instantly share code, notes, and snippets.

View mikedao's full-sized avatar
🤷

Michael Dao mikedao

🤷
View GitHub Profile

Enums Homework Part 1

Do by April 4.

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

Do the following in order:

* 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.
  • 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?

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?

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

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

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

Solo

Given the array

["Harry Potter", "Hermione Granger", "Ron Weasley", "Luna Lovegood"]

Use #each to do the following:

  1. Print out each name.
  2. Print out each name in lower case.
By Ramona Flour et al.
1. Being a woman is kind of like being a cyclist in a city where all the cars represent men.
2. You're supposed to be able to share the road equally with cars, but that's not how it works.
3. The roads are built for cars and you spend a great deal of physical and mental energy being defensive and trying not to get hurt.
4. Some of the cars WANT you to get hurt. They think you don't have any place on the road at all.
5. And if you do get hurt by a car, everyone makes excuses that it's your fault.
6. Bicycle lanes are built just for you, and then the cars drive in those too.
7. And you can't go out at night because cars will run right over you.
8. You better watch out for the drunk ones.

Module 1 Week 2 Diagnostic

This exercise is intended to help you assess your progress with the concepts and techniques we've covered during the week.

When complete, fill out this form.

For these questions, write a short snippet of code that meets the requirement. In cases where the question mentions a "given" data value, use the variable given to refer to it (instead of re-writing

  • When you think of academic integrity, what are the first three or four things that come to mind?
  • Why does academic integrity matter?
  • What do you think plagaiarism is in context of software development?