Question 6(c) 2018 · May-June · Paper 12 · 2 marks
Reveal official mark-scheme answer
Official answer for Question 6
Part (c)
Question 1
mark pe
Question 2
- T akes the va
- S tores (it) in the variable
Show text version of question
Question 6
Part (c)
Question 6
A web page includes the following HTML and JavaScript code.
01 <html> 02 <body> 03 04 <p>Enter your mark</p> 05 <input id="Mark" value="0"> 06 <button onclick="calcGrade()">Enter</button> 07 08 <script> 09 function calcGrade() { 10 var mark, grade; 11 mark = document.getElementById("Mark").value; 12 if (mark >= 90) { 13 grade = "A" 14 } else if (mark >= 80) { 15 grade = "B" 16 } else if (mark >= 70) { 17 grade = "C" 18 } else if (mark >= 60) { 19 grade = "D" 20 } else if (mark >= 50) { 21 grade = "E" 22 } else { 23 grade = "U" 24 } 25 alert("Your grade is " + grade) 26 } 27 </script>
Question 28
29 </body> 30 </html>
Part (c)
Describe the purpose of the statement on line 11.
...................................................................................................................................................
...............................................................................................................................................[2]
Question 11
Why this question appears here
71% assigned-topic match · Programming › Programming basics
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_s18_qp_12.pdf
