This shows you the differences between two versions of the page.
| Next revision | Previous revision | ||
|
en:web_development:lists:exercise [2021/12/03 06:08] mag created |
en:web_development:lists:exercise [2023/08/16 09:33] (current) |
||
|---|---|---|---|
| Line 1: | Line 1: | ||
| - | ====== Web Development Lesson | + | ====== Web Development Lesson |
| ===== Exercises ===== | ===== Exercises ===== | ||
| Try the following exercises to practice what you've learnt about lists. | Try the following exercises to practice what you've learnt about lists. | ||
| Line 19: | Line 19: | ||
| ==== Factorial ==== | ==== Factorial ==== | ||
| Write a Javascript program that calculates the factorial of a number provided by the user. The factorial of 4 is 1x2x3x4. In Javascript, the multiplication symbol is written as </ | Write a Javascript program that calculates the factorial of a number provided by the user. The factorial of 4 is 1x2x3x4. In Javascript, the multiplication symbol is written as </ | ||
| + | |||
| + | ==== Guessing Game ==== | ||
| + | Are you ready for a coding challenge? Write a game that | ||
| + | * defines a number between 1 and 10 | ||
| + | * prompts the user for a number between 1 and 10 | ||
| + | * checks the value and returns whether the number was correct or not (HINT: use an ' | ||
| + | * runs 3 times before stopping (HINT: use a 'for loop') | ||
| + | |||
| + | ==== Working Examples ==== | ||
| + | * [[https:// | ||
| + | * [[https:// | ||
| + | * [[https:// | ||
| + | * [[https:// | ||
| [[en: | [[en: | ||