Skip to content

Instantly share code, notes, and snippets.

@appoll
Created February 25, 2022 19:14
Show Gist options
  • Save appoll/4b7bd5843026a01bec847a45aecaf6d3 to your computer and use it in GitHub Desktop.
Save appoll/4b7bd5843026a01bec847a45aecaf6d3 to your computer and use it in GitHub Desktop.
// 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