Introduction to Ruby and Introduction to Ruby on Rails basic concepts for beginners. The google presentation is even better in full screen https://docs.google.com/presentation/d/1EE0VuB_PkD2-8j5JNs6CUQHb4J9ToIgC7-IxYTojiS0/pub?start=false&loop=false&delayms=3000#slide=id.p
36. Mam, please take
each item for me to
bill
cart = [“biscuit”, milk”, “shampoo”, “tampons” ]
cart.each do |item|
puts item
end
37. Exercise 2
- Create an array of marks you got in your
last assessment.
- Find if the sum of odd numbers is greater
than the sum of even numbers, if it is, you
have big odds at passing.
- Pass this information or bad luck will follow
42. Alternate way to write hash
slang = {
lol: “laugh out loud”,
brb: “Be right back”
}
slang[:lol]
=> laught out loud
43. Exercise 3
- Create a list of ipl team hashes
- with batsmen (3) name as key and their
sixes as values.
a) Find the sixes hit by a batsmen of a given
name
46. Exercise 4
a) Create a method rajini_style. Return his
dialogue (your favorite).
b) Create a factorial method that gets a
number and returns the factorial