Edexcel IGCSEComputer ScienceGeneral Applications6 Marks
A student is creating a program that uses a function to calculate the area of a circle. The function takes the radius as an argument and returns the area.
- (a)Write pseudo-code for a function called `CalculateArea` that takes `Radius` as a parameter, calculates the area (using πr²), and returns the result. Use π = 3.14.[3]
- (b)Explain the benefit of using functions (subroutines) in programming.[3]
Mark scheme
Marking points from the official mark scheme. The mark or mark type is shown in brackets.
- 8(a) M1 for `FUNCTION CalculateArea(Radius)`. (Correct header/parameters)
- M1 for `Area = 3.14 * Radius * Radius`. (Correct calculation)
- A1 for `RETURN Area`. (Correct return statement)
- 8(b) M1 for code reusability / avoid repetition.
- M1 for makes code easier to read/understand / modularity.
- A1 for easier to debug/test / easier to maintain / breaks down complex problems into smaller parts.
Write your answer and get it marked
On Oracle Prep you can write or photograph your own answer and have it marked by AI against this mark scheme, with feedback on what you missed.
Sign up free →