~~CLOSETOC~~ |<100% 25% - >| ^ \\ DATA ANALYTICS REFERENCE DOCUMENT\\ \\ ^^ ^ Document Title:|Web Development week 8 assignments| ^ Document No.:|1552342813| ^ Author(s):|Gerhard van der Linde| ^ Contributor(s):| | **REVISION HISTORY** |< 100% 10% - - 10% 17% 10% >| ^ \\ Revision\\ \\ ^\\ Details of Modification(s)^\\ Reason for modification^ \\ Date ^ \\ By ^ | [[:doku.php?id=worksheet:webdev:web_dev_week8&do=revisions|0]] |Draft release|Web Development week 8 assignments| 2019/03/11 22:20 | Gerhard van der Linde | ---- ====== Web Development - Week 8 ====== {{:modules:46376:pdf:week_8_excercise.pdf|Worksheet - Using the DOM}} ===== Exercise 1 ===== DOM Manipulate

This is JavaScript

===== Exercise 2 - Basic Calculator ===== Create a web page that has 2 input boxes and a button that adds up the numbers in the boxes. Basic Calculator ===== Exercise 3 - Advanced calculator ===== {{ submissions:worksheet:webdev:advance_calculator.png?nolink&400 |}} Advanced Calculator

Calculator

Number 1:

Number 2:

Answer

Code provided by Mike. Calculator

Calculator

Number 1:



Number 2:





Answer:

===== Exercise 4 - Guessing Game 1 to 10 ===== Write a JavaScript program where the program generates a random number between 1 to 10 . The user is then prompted to input a number. If the number the user input matches with the random number, the program will display a message "Good Guess", otherwise display a message "Sorry, wrong number". How to generate a random number between 1 and 10 in JavaScript: var num = Math.ceil(Math.random() * 10); Basic Calculator

Guess the secret:

===== Exercise 5 - Guessing Game 1 to 100 ===== {{ submissions:worksheet:webdev:guess_100.png?nolink&400 |}} Write a JavaScript Guessing Game program where the program chooses a random number between 1 to 100. The user is then prompted to guess the number the program chose. The user has six attempts to guess the right number. After each attempt, if the number is incorrect, the program will display “Guess too high” or “Guess too low” depending on the user input. If the user has not guessed the correct number after 6 attempts, the game ends and the number the program generated is displayed. Basic Calculator

secret

You have 6 attempts to guess the right value.

Guess the secret:

Code provided by Mike Guessing Game 1 to 100