Note AcademyNote Academy

Computer Science (AS & A Level) · Oct / Nov 2022 · Paper 42 · Question 2

9618

As printed in the paper

The question as text

A computer game is being developed. The game has 10 different characters that are all active in the game. Part of the game is being written using object-oriented programming. The class Character stores data about the characters. Each character has a name and the x coordinate and y coordinate of their current position. Character Name : STRING XCoordinate : INTEGER YCoordinate : INTEGER stores the name of the character stores the x coordinate stores the y coordinate Constructor() GetName() GetX() GetY() ChangePosition() initialises Name, XCoordinate and YCoordinate from the values passed as parameters returns the name of the character returns the x coordinate of the character returns the y coordinate of the character takes XChange as an integer parameter and adds it to the x coordinate takes YChange as an integer parameter and adds it to the y coordinate

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

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

  • 2(b)[3]

  • 2(c)[2]

  • 2(d)[7]

  • 2(e)[5]

  • 2(f)[7]

  • 2(g)(i)[2]

  • 2(g)(ii)[1]

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