May/June 2026 Paper 21

2026 · 9 questions · 28 parts · 75 marks

0/75 marks
0Correct0Partial0Wrong28Unattempted
Filters0 active

Questions

Select a part to jump to its question

Finish set
5(a)Subroutines Scope Modular ProgrammingMedium4 marks
Electric light bulbs are advertised online with the price showing:
text
$1.75 each or 20 bulbs for $30.00
A pseudocode function BulbCost()
  • takes the quantity of bulbs purchased as its single parameter
  • returns the total cost in dollars.
Pseudocode for the main program:
  • inputs the number of bulbs purchased
  • returns the total cost from the function BulbCost()
  • outputs the total cost.
Write pseudocode for the function BulbCost()

Answer

0 words
5(b)Subroutines Scope Modular ProgrammingEasy1 mark
The main program accepts a user input for the quantity of bulbs purchased and calls function BulbCost() Complete the pseudocode for the main program.
pseudocode
// Main programDECLARE NumberPurchased : INTEGERDECLARE TotalCost : REALOUTPUT "How many bulbs? "INPUT NumberPurchased