Skip to main content
A-LevelComputer ScienceFurther programming9618/31 · May/June 2022 · Q711 Marks

A program is to be written using Object-Oriented Programming (OOP) for a shop that sells knitting yarn. There are three types of yarn: acrylic, wool or mix. The following data are stored for each type. • Name • Colour • Batch code • Weight • Number of balls of yarn in stock (can be edited) • Type of yarn The following statements apply to yarn. • Acrylic can be soft or not soft. • Wool can be lamb, merino or alpaca. • Mix contains a percentage of acrylic. Each type of yarn has a method that will display all the information about the yarn.

  1. (a)Complete this class inheritance diagram to show the properties, methods and inheritance. Yarn Name: STRING Colour: STRING BatchCode: STRING Weight: INTEGER NumberBalls: INTEGER Type: STRING Constructor() EditNumberBalls() YarnInfo() Acrylic Wool Constructor() Mix Percentage: INTEGER Constructor() YarnInfo()[5]
  2. (b)Describe what is meant by the terms properties, methods and inheritance. Properties Methods Inheritance[6]

Mark scheme

Marking points from the official mark scheme (May/June 2022). The mark or mark type is shown in brackets.

  1. [5] 7(a) 1 mark per point Acrylic has attribute Soft of type BOOLEAN Wool has attribute WoolType with suitable data type Acrylic and Wool have method YarnInfo() Acrylic, Wool and Mix at least one inherit (one arrow correct) from Yarn Acrylic, Wool and Mix all inherit (all arrows correct) from Yarn
  2. [6] 7(b) Properties max 2: • the data items / attributes • the data types // characteristics • defined in a class Methods max 2: • the procedures/functions / programmed instructions in a class / super class / base class • implementing the behaviours • that act on the properties / attributes Inheritance max 2: • Methods and properties / attributes contained in one class/ super class / base class • Are made available to / reused by another class/ derived class

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 →

About this question

Topic
Further programming, A-Level Computer Science (syllabus 9618). Structured question, 11 marks.
Source
A-Level Computer Science, May/June 2022 Paper 3 Variant 1, question 7.

Questions and mark schemes are from past examination papers and remain the copyright of the exam board. How Oracle Prep builds its content

Related Computer Science questions

© 2026 Oracle Prep