Skip to content

Instantly share code, notes, and snippets.

@joeletizia
Last active August 29, 2015 14:25
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 joeletizia/985281ba3f397eef156e to your computer and use it in GitHub Desktop.
Save joeletizia/985281ba3f397eef156e to your computer and use it in GitHub Desktop.
Dakarai Homework

Write the following functions

  1. A function named dog that prints out "Woof!" to the screen.
  2. A function named cat that prints out "Meow." to the screen.
  3. A function named hello_name that takes a string as input and prints out "Hello, name!" where name is the string given as input.
  4. A function named even? that takes a number as input and returns true if the number is evenly divisibly by 2 and false otherwise.
  5. A function named multiple_of? that takes 2 inputs. For example: multiple_of?(2, 4) returns true because 4 is a multiple of 2 (2*2 = 4). multiple_of?(5, 32) returns false because 32 is not a multiple of 5.
  6. A function named count that takes a number as input and prints out all the numbers between 0 and number to the screen.
  7. A function named multiples that takes a number as input, and returns an array containing all results of the given number multiplied by the numbers from 1 to 10. So for multiples(5) the result should be [5,10,15,20,25, ...]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment