Lund University gis centre Lund University, Lund, Sweden JavaScript
Download 216.11 Kb. Pdf ko'rish
|
02-JavaScript
- Bu sahifa navigatsiya:
- JavaScript Aim
- Report Submit your codes with screenshots of the results to AC. Tasks
- Task 2: Web forms and calculations
- Task 3: Web forms
1 © Copyright 2019-2025. GIS Centre, Lund University, Sweden Exercise created by Ali Mansourian, 2020-03-01 Lund University GIS Centre Lund University, Lund, Sweden JavaScript 2 © Copyright 2019-2025. GIS Centre, Lund University, Sweden Exercise created by Ali Mansourian, 2020-03-01 JavaScript Aim The aim of this exercise is to use your HTML and JavaScript programming skills to develop some simple programs. Consider it as a warm up exercise! Requirements You need to know about HTML and JavaScript syntaxes. Also need to have a text editor such as Notepad++ for writing your codes. A web browser such as Chrome or Firefox is needed for running the codes and presenting the results. Report Submit your codes with screenshots of the results to AC. Tasks This exercise consists of three tasks as below. Task 1: calculation using recursive function Using recursive function, write a program that: • Gets an integer number (n) as an input ( hint: Use prompt(“ ”,” ”); ) • Calculates ∑ 1 𝑥𝑥 2 𝑛𝑛 𝑥𝑥=1 (hint: to calculate 𝑥𝑥 2 use Math.pow(x,2) ) • Shows the result in a browser 3 © Copyright 2019-2025. GIS Centre, Lund University, Sweden Exercise created by Ali Mansourian, 2020-03-01 Task 2: Web forms and calculations a) Create a user interface including: a text box for input value (X), a text box for output value (Y) and a button (Determine), similar to the figure, below. b) It is desired that user can enter an integer value for X. By clicking on the “Determine” button, the value of Y should be calculated according to the equation below and shown in the Output (Y) text box. Y = (X + 1) 2 Note: You may need to change the data type of “X” from String to Integer, before using the value in your calculations. Task 3: Web forms a) Create a user interface including 4 radio buttons (each button for one color) and a text box (similar to the figure, below) b) It is desired that by selecting each color (radio button), the name of the color is shown in the text box. Document Outline
Download 216.11 Kb. Do'stlaringiz bilan baham: |
Ma'lumotlar bazasi mualliflik huquqi bilan himoyalangan ©fayllar.org 2024
ma'muriyatiga murojaat qiling
ma'muriyatiga murojaat qiling