Created
February 25, 2022 19:14
-
-
Save appoll/4b7bd5843026a01bec847a45aecaf6d3 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 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 string which contains the same word more times. | |
| // The word and the number of times should be passed in as parameters. | |
| // printWordManyTimes("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