Programming for the web
166 questions. Open a question to solve it and check the official answer.
Programming for the web · 1 mark · official answer ready
(iv) operator ........................................................................................................................................... .........................…
Programming for the web · 1 mark · official answer ready
(v) statement ........................................................................................................................................... .........................…
Programming for the web · 4 marks · official answer ready
(b) Describe, in detail, the use of console.log() in JavaScript to output data for display. .......................................................................................…
Programming for the web · 0 marks · official answer ready
5 (a) The JavaScript code shown in Fig. 5.1 adds together 12 and 6 to produce the result 18. Line numbers are shown only for reference purposes. 1 2 3 4 5
Programming for the web · 15 marks
5 Open the MarkConversionTask.html file in a text editor. Add JavaScript code to prompt the user to enter a mark and display the mark entered and the correct grade using the text:…
Programming for the web · 8 marks · official answer ready
(b) Describe four form controls that could be used on the new booking screen and for each form control describe an appropriate use on the new screen. .............................…
Programming for the web · 0 marks
9 In JavaScript, conditional statements can be used to carry out specific actions based upon different conditions. The value of the variable ‘age’ is entered into a web page and c…
Programming for the web · 6 marks · official answer ready
(a) Explain, with reference to the code in the function, how the ‘if else’ and ‘else if’ statements operate to provide the appropriate statement when an age is entered into the we…
Programming for the web · 4 marks · official answer ready
(b) The code could have been written using the ‘switch’ function, e.g. lines 4 to 7 could have been: 4 switch(true) { 5 case age < 10: 6 statement = "You are not old enough to go …
Programming for the web · 6 marks
10 } Fig. 9.1 (a) Explain, with reference to the code in the function, how the ‘if else’ and ‘else if’ statements operate to provide the appropriate statement when an age is enter…
Programming for the web · 0 marks · official answer ready
11 The area of a rectangle can be calculated using the JavaScript embedded in a web page as shown below. 1 2 3 4 var length = parseFloat(prompt("Enter length of the rectangle : ")…
Programming for the web · 6 marks
19 17 Explain, with reference to the code shown, how the JavaScript collects the dimensions of the rectangle, calculates the area and displays the area on-screen. The lines of the…
Programming for the web · 0 marks · official answer ready
3 JavaScript uses strings to store data. This script is intended to display the contents of three variables on a web page. Line numbers are provided only for your convenience when…
Programming for the web · 3 marks · official answer ready
12 Explain, giving reasons, why no output is produced when this JavaScript is executed by a web browser as part of a web page. ....................................................…
Programming for the web · 8 marks
(a) Explain, in detail, how the JavaScript code produces this list from an array. corn rice maize sugarcane .......................................................................…
Programming for the web · 36 marks
(b) Explain how you would amend the existing JavaScript code to add ‘beans’ to the array so that it would produce this list. beans corn rice maize sugarcane ......................…
Programming for the web · 0 marks · official answer ready
11 The area of a rectangle can be calculated using the JavaScript embedded in a web page as shown below. 1 2 3 4 var length = parseFloat(prompt("Enter length of the rectangle : ")…
Programming for the web · 6 marks
19 17 Explain, with reference to the code shown, how the JavaScript collects the dimensions of the rectangle, calculates the area and displays the area on-screen. The lines of the…
Programming for the web · 5 marks
4 (a) Open the Scroller.html file in a browser. Use the Next and Previous buttons to scroll through the images. There is an error in the script that is used to display the images.…
Programming for the web · 6 marks
(b) Amend the scroller so that instead of displaying alerts, the scroller cycles through the images, forwards and backwards, continuously. Insert programmer comments to explain an…
