Past-paper question · 2019 October-November · Paper 33 · Q11

Question 11 2019 · October-November · Paper 33 · 0 marks

Original past-paper question for 11
Reveal official mark-scheme answer Official mark-scheme answer for 11

Official answer for Question 11

✓
Six from:

Question 6

✓
Line 4 declares the variable/var length to hold one side of rectangle
✓
Line 5 declares the variable/var width to hold other side of rectangle
✓
parseFloat (prompt(“”)); used to display message
✓
parseFloat (prompt(“”)); used to collect values for both sides of rectangle
✓
parseFloat (prompt(“”)); used to create a (text) box for the user to enter the
✓
values
✓
Variable/var calc_area is declared to calculate the area
✓
Holds result of calculation
✓
document.write() is used to display the messages on screen about the
✓
values/area of the rectangle
✓
Displays the results of the calculation/contents of var calc_area.

Mark scheme 9626_w19_ms_33.pdf →

Show text version of question

Question 11

The area of a rectangle can be calculated using the JavaScript embedded in a web page as shown below.

1 <html> 2 <body> 3 <script> 4 var length = parseFloat(prompt("Enter length of the rectangle : ")); 5 var width = parseFloat(prompt("Enter width of the rectangle : "));

Question 6

7 var calc_area = (length * width);

Question 8

9 document.write("<br>"); 10 document.write("<h3> Area of a rectangle</h3>"); 11 document.write("<font face='arial' size='3'>")

Topic relevance

Why this question appears here

98% assigned-topic match · Programming for the web

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 9626_w19_qp_33.pdf

Keep practising this topic