Note AcademyNote Academy

Computer Science (AS & A Level) · Oct / Nov 2021 · Paper 41 · Question 2

9618

As printed in the paper

The question as text

A program, written using object-oriented programming, stores pictures as objects. The program stores the dimensions of the picture (width and height), the colour of the frame (e.g. black), and a description of the picture (e.g. flowers). The class has the following attributes and methods. Picture Description : STRING Width : INTEGER Height : INTEGER FrameColour : STRING // stores a description of the picture // stores the width e.g. 30 // stores the height e.g. 40 // stores the colour e.g. black Constructor() GetDescription() GetHeight() GetWidth() GetColour() SetDescription() // takes all four values as parameters and sets them to the private attributes // returns the description of the picture // returns the height // returns the width // returns the frame colour // takes the new description as a parameter and writes the value to description

Read automatically from the paper; the printed page above is exact.

Show the answer and mark scheme
  • 2(a)[5]

  • 2(b)[3]

  • 2(c)[2]

  • 2(d)[1]

  • 2(e)[8]

  • 2(f)[2]

  • 2(g)[7]

  • 2(h)[2]

Make a free account to save your answers and see your weak topics and ask the AI why a wrong answer is wrong.