All Exercises

Exercise
Correct!
False!
Substration of 2 numbers
- Input: 2 numbers (ex: 42 and 38)
- Output: The difference (ex: 4)
function subs(a, b) { }

Exercise
Correct!
False!
Even or Odd number?
- Input: A number (ex: 42)
- Output: A string that is either "Even" or "Odd" (ex: "Even")
function evenOrOdd(n) { }

Exercise
Correct!
False!
Find the maximum of 2 numbers
- Input: 2 numbers (ex: 42 and 38)
- Output: The biggest number (ex: 42)
function maxOfTwoNumbers(a, b) { }

Exercise
Correct!
False!
Find the maximum of 3 numbers
- Input: 3 numbers (ex: 42, 38 and 12)
- Output: The biggest number (ex: 42)
function maxOfThreeNumbers(a, b, c) { }

Exercise
Correct!
False!
Calculate the sum of all elements
Input: Array of number (ex: [2, 10, 30])
Output: The sum (ex: 42)
function sumArray(array) { }

Exercise
Correct!
False!
Find the maximum of a non-empty array
- Input: Array of numbers (ex: [ 3, 5, 42, 12, 38 ] )
- Output: The biggest number (ex: 42 )
function maxOfArray(numbers) { }

Exercise
Correct!
False!
Find the longest word
- Input: Array of strings (ex: [ "car", "plane", "bike"])
- Output: The longest string (ex: "plane")
function findLongestWord (words) { }

Exercise
Correct!
False!
Finding a word inside an array
- Input: Array of strings and a string (ex: ["Madrid", "Barcelona", "Miami"] and "Paris")
- Output: A boolean that is true when the word is in the array (ex: false)
function doesWordExist(wordsArray, word) { }

Exercise
Correct!
False!
Get the fullname
- Input: An object with at least 2 string properties "firstname" and "lastaname" (ex: {firstname: "John", lastname: "Doe"})
- Output: A string the represents the fullname (dont' forget the space in the middle) (ex: John Doe)
function getFullname(person) { }

Exercise
Correct!
False!
Find the maximum of a two dimensional array
- Input: Array of array of numbers (ex: [ [1,6], [3,8], [5,6] ] )
- Output: The maximum of everything (ex: 8 )
function maxTwoDimArray(matrix) { }

Exercise
Correct!
False!
Build a triangle
- Input: A number "n" (ex: 2)
- Output: An array of length "n", that contains an array of "*" with a size incrementing by one each time (ex: [ ["*"],["*","*"] ])
Example output for 4:
[ ["*"], ["*","*"], ["*","*","*"], ["*","*","*","*"], ]
function buildTriangle(n) { }

results matching ""

    No results matching ""