User Tools

Site Tools


en:web_development:lists:exercise

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

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 - Lists ======+====== Web Development Lesson - Lists ======
 ===== 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 </html>*</html> (ie product = 2*4). 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 </html>*</html> (ie product = 2*4).
 +
 +==== 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 'if' statement)
 +  * runs 3 times before stopping (HINT: use a 'for loop')
 +
 +==== Working Examples ====
 +  * [[https://techschool.murraygunn.id.au/webdev/classes/lists/5/ol.html|listas ordenadas]]
 +  * [[https://techschool.murraygunn.id.au/webdev/classes/lists/5/even.html|numeros pares]]
 +  * [[https://techschool.murraygunn.id.au/webdev/classes/lists/5/factorial.html|factorialesl]]
 +  * [[https://techschool.murraygunn.id.au/webdev/classes/lists/5/guess.html|juego de adivinanzas]]
  
 [[en:web_development:lists:summary|Next: Summary]] [[en:web_development:lists:summary|Next: Summary]]
en/web_development/lists/exercise.1638540496.txt.gz · Last modified: 2023/08/16 09:33 (external edit)