Past-paper question · 2018 May-June · Paper 13 · Q1(d)

Question 1(d) 2018 · May-June · Paper 13 · 1 mark

Original past-paper question for 1(D)
Original past-paper question for 1(D)
Original past-paper question for 1(D)
Reveal official mark-scheme answer Official mark-scheme answer for 1(D)

Official answer for Question 1

Part (d)

✓
Server-side

Question 1

✓
Question
✓
Answer
✓
Marks

Mark scheme 9608_s18_ms_13.pdf →

Show text version of question

Question 1

Part (d)

Question 1

A
web page includes the following HTML and PHP code.

01 <?php 02 if(isset($_GET['mark'])) { 03 echo "Grade: " . calculateGrade($_GET['mark']); 04 } else { 05 ?> 06 07 <form action="#" method="get"> 08 Enter Mark: <input type="text" name="mark" /><br /> 09 <input type="submit" value="Calculate" />

Question 10

</form>

Question 11

Question 12

<?php

Question 13

}

Question 14

Question 15

function calculateGrade($inputMark) {

Question 16

$gradeChar = "U";

Question 17

if($inputMark >= 80) $gradeChar = "A";

Question 18

else if($inputMark >= 70) $gradeChar = "B";

Question 19

else if($inputMark >= 60) $gradeChar = "C";

Question 20

else if($inputMark >= 50) $gradeChar = "D";

Question 21

else if($inputMark >= 40) $gradeChar = "E";

Question 22

return $gradeChar;

Question 23

}

Question 24

?>

Part (d)

State whether this PHP code will run client-side or server-side.

...............................................................................................................................................[1]

Question 3

Topic relevance

Why this question appears here

71% assigned-topic match · Hardware › Logic gates and logic circuits

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_13.pdf

Keep practising this topic