Question 6(a) 2023 · February-March · Paper 22 · 3 marks
Reveal official mark-scheme answer
Official answer for Question 6
Part (a)
Question 3
- Line 05 OUTPUT UsefulEnergyOut should be INPUT UsefulEnergyOut
- Line 06 IF TotalEnergyIn <> -1 AND UsefulEnergy <> -1 should be:
- Line 11 UNTIL TotalEnergyIn <> -1 OR UsefulEnergyOut <> -1 should be:
Show text version of question
Question 6
Part (a)
Question 6
The energy efficiency of an electrical appliance is the percentage of useful energy out compared with
the total energy in.
An algorithm has been written in pseudocode to calculate the energy efficiency of an appliance. Values for total energy in and useful energy out are input. The efficiency is calculated and output as a percentage. The entry of the number –1 for either value stops the algorithm.
01 REPEAT 02 OUTPUT "Enter total energy in " 03 INPUT TotalEnergyIn 04 OUTPUT "Enter useful energy out " 05 OUTPUT UsefulEnergyOut 06 IF TotalEnergyIn <> -1 AND UsefulEnergy <> -1 07 THEN 08 Efficiency (UsefulEnergyOut / TotalEnergyIn) * 100 09 OUTPUT "Efficiency is ", Efficiency, "%" 10 ENDIF 11 UNTIL TotalEnergyIn <> -1 OR UsefulEnergyOut <> -1
Part (a)
Identify the three errors in the pseudocode and suggest corrections.
Error 1 .......................................................................................................................................
Correction .................................................................................................................................
...................................................................................................................................................
Error 2 .......................................................................................................................................
Correction .................................................................................................................................
...................................................................................................................................................
Error 3 .......................................................................................................................................
Correction .................................................................................................................................
...................................................................................................................................................
Why this question appears here
98% assigned-topic match · Algorithm design and problem-solving
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 0478_m23_qp_22.pdf
