Created
November 25, 2022 18:20
-
-
Save appoll/1d978b34d81ed70963c555464341f2ea to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// E0. | |
// Write a void function that | |
// prints the sum of two numbers. | |
// The 2 numbers should be passed in as parameters | |
// e.g. add(3,5) | |
function addNumbers(number1, number2){ | |
console.log("The sum is:..."); | |
} | |
addNumbers(10, 100); | |
addNumbers(15, 20); | |
// E1. | |
// Write a function that takes as parameters: the userName, | |
// and the userBirthMonth and prints the following: | |
// "Hello, <userName>. Your birth month is: <birthMonth>" | |
function helloUser(userName, birthMonth) { | |
} | |
helloUser("Paul", "July"); | |
helloUser("Fredi", "Mai"); | |
// E2. | |
// Write a function that builds a song by repeating a word. | |
// The word and the number of times should be passed in as parameters. | |
// singSong("hello", 5); | |
// hellohellohellohellohello | |
function singSong(word, count){ | |
} | |
singSong("la", 7); | |
singSong("dum", 10); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment