Skip to content

Instantly share code, notes, and snippets.

@leahgarrett
Last active April 15, 2019 00:13
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save leahgarrett/56c089a3baf4390fbc9312c7987ba05b to your computer and use it in GitHub Desktop.
Save leahgarrett/56c089a3baf4390fbc9312c7987ba05b to your computer and use it in GitHub Desktop.
Term 1 Revision - Kahoot solutions

Term 1 Revision

Joli - https://gist.github.com/M0119/7fa393f438dc9768f5cfbdedcbbaf0db

MVC

Review this article (~5 min read), it provides a good analogy for MVC - review & understand
https://medium.freecodecamp.org/model-view-controller-mvc-explained-through-ordering-drinks-at-the-bar-efcba6255053

MVC Review last term's MVC Challenge

https://gist.github.com/leahgarrett/4e5694ead5e43848b3c6ca647d77350e And sample solutions https://gist.github.com/leahgarrett/5209e2072147dac0c6cb0ea0cf3affca

Canvas Challenge

https://coderacademy.instructure.com/courses/162/pages/unit-rails-intro-and-mvc?module_item_id=7036

Kahoot

Q) What is the result of 5 == 5
a. 5
b. true
c. false
d. nil

Q) What is the datatype of “Integer”?
a. Number
b. nil
c. Integer
d. String

Q) Which of the following best describes ‘type coercion’ (as related to coding)?
a. It’s what occurs when you use a function that creates a different data type from that which it is operating on
b. Implicit conversion of one type to another
c. Assignment of the value of one variable to another variable
d. The cause of type error bugs

Q) What is a Gem?
a. IRB
b. A standard format for distributing Ruby programs and libraries
c. A jewel
d. Ruby on rails

Q) Case statements can be most efficiently rewritten as:
a. if/elsif/else statements
b. for loops
c. do/while loops
d. blocks

Q) If I have an array of numbers, and wanted to print them to screen, which answer best achieves this aim?
a. num_arr for each do |num| { puts num }
b. num_arr.each do { puts num }
c. num_arr.each { |num| puts num }
d. num_arr.each do |num| { puts num }

Q) Which of the following creates a new Car object whose initialize function takes one argument?
a. speedie = Car.new(“Speedie”)
b. speedie = new.Car(“Speedie”)
c. speedie = Car.new
d. speedie = new.Car

Q) For an array, arr = [1, 2, 3]. What does the expression arr[1] evaluate to? a. error
b. 1
c. 2
d. 3

Q) Which option takes input from the User and converts it to an Integer a. get b. int i = get c. gets.to_i d. int i = gets

Q) For a string s, which method below makes all characters uppercase and modifies the variable with the updated string
a. s.upcase
b. s.upcase!
c. s.capitalize
d. s.capitalise!

Q) In MVC, what type of code goes in the model?
a. Presentation Code
b. Business logic or glue
c. Data

Q) What symbol is used to create an instance variable?
a. #
b. @
c. !
d. ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment