Create a new variable called language
. Then create a conditional that handles printing:
- Hola, Martin if language is equal to
"spanish"
- Salut, Martin if language is equal to
"french"
- Hello, Martin if language is equal to
"english"
- I am not sure what are you trying to do, sorry! 🍺 if language is equal to anything else.
Bonus: Use prompts to determine what language will be set to as well as the name that should be consoled.
Hint: For bonus part, you have to use repl.it with HTML, CSS and JS, instead only with JS.
Write a program that asks the user to enter a number between 1 and 7 (inclusive) and then displays the corresponding day of the week.
For example, if the user enters 1, the program should output "Monday"; if the user enters 2, the program should output "Tuesday"; and so on.
To accomplish this, you can use a switch statement with cases for each possible input value, and a default case to handle invalid inputs.