Skip to content

Course home

Sign up

Develop code

EasyMediumHard
12345678910111213141516171819
Question 17

A programmer has written a procedure to apply a promotional discount to specific items in a bookstore inventory list. The list inv stores items in the format [itemID, title, genre, price].

PROCEDURE applyDiscount()
BEGIN PROCEDURE
FOR x FROM 0 TO LENGTH(inv) - 1 DO
IF inv[x,2] == "Fiction" THEN
SET inv[x,3] TO inv[x,3] * 0.85
END IF
END FOR
END PROCEDURE

State two changes that could be made to this pseudocode to improve its readability.

[2]
Markscheme

Develop code Questions

  1. GCSE
  2. /Computer Science
  3. /Develop code

51 exam-style questions on Edexcel GCSE Computer Science Develop code, covering Decomposition and abstraction to solve problems, Read, write, analyse and refine programs, Converting algorithms into programs, Techniques for readable, maintainable code, Identifying and correcting program errors, and Evaluating program fitness and efficiency. Each one has a worked solution and a mark scheme showing where the marks go.

Question bank