Past-paper question · 2017 May-June · Paper 12 · Q6(c)(iii)

Question 6(c)(iii) 2017 · May-June · Paper 12 · 1 mark

Question 6

Part (c)

(iii)

Question 6

Downloading a file from a website is an example of a client-server application.

The following web page used for data capture consists of:

  • two text boxes for the entry of:
  • ° a race runner’s ID code ° their finishing position in a race.

  • a button that the user clicks to submit this runner’s result.

1 <html> 2 <head> 3 <title>Untitled Document</title> 4 <script language="JavaScript">

Question 5

6 function myButton_onmousedown() 7 { 8 var Output1 = "Runner ID OK"; 9 var Output2 = "ERROR – entry refused";

Question 10

11 var Runner ID = document.forms["form1"]["txtRunnerID"].value; 12 // || in Javascript is the 'OR' operator 13 if (RunnerID.substr(0,3) == "VAR" || RunnerID.substr(0,3) == "CAM") 14 { 15 alert(Output1) 16 } 17 else 18 { 19 alert(Output2) 20 } 21 } 22 </script>

Question 23

24 </head> 25 <body> 26 <form name = form1> 27 <label>Runner ID: </label> 28 <input type="text" name="txtRunnerID" > 29 <label>Position: </label> 30 <input type="text" name="txtPosition" size = "5" > 31 <p> 32 <label>Save data: </label> 33 <input type="button" name="btnSubmit" Value = "Submit"

Question 34

35 onMouseDown = "myButton_onmousedown()" > 36 </p> 37 </form>

Question 38

39 </body> 40 </html>

Question 13

(iii)

The JavaScript code uses a selection statement.

State the line number which contains its condition.

Line number: ....................................

[1]
Reveal official mark-scheme answer Official mark-scheme answer for 6(C)(III)

Official answer for Question 6

Part (c)

(iii)

Question 13

Question 1

Mark scheme 9608_s17_ms_12.pdf →

Topic relevance

Why this question appears here

71% assigned-topic match · Programming › Constructs

Topic-match percentages estimate how closely each question fits the selected syllabus topic. They are a guide for choosing stricter or broader practice.

Permanent source page: Educate A Change · From 9608_s17_qp_12.pdf

Keep practising this topic