Computer Science (AS & A Level) · May / June 2023 · Paper 43 · Question 2
9618
As printed in the paper
The question as text
A computer game is being designed that will include different vehicles. A prototype for the game is being developed using object‑oriented programming. The class Vehicle stores data about the vehicles. Each vehicle has an identification name, a maximum speed, a current speed and a horizontal position. The value IncreaseAmount is added to the current speed each time the vehicle increases its speed. Vehicle ID : STRING MaxSpeed : INTEGER CurrentSpeed : INTEGER IncreaseAmount : INTEGER HorizontalPosition : INTEGER stores the identification name for the vehicle stores the maximum speed stores the current speed stores the amount CurrentSpeed increases by stores the horizontal position Constructor() GetCurrentSpeed() GetIncreaseAmount() GetHorizontalPosition() GetMaxSpeed() SetCurrentSpeed() SetHorizontalPosition() IncreaseSpeed() initialises ID, MaxSpeed and IncreaseAmount to the parameter values initialises both CurrentSpeed and HorizontalPosition to 0 returns the current speed returns the increase amount returns the horizontal position returns the maximum speed assigns the parameter to the current speed assigns the parameter to the horizontal position calculates and stores the new speed and horizontal position of the vehicle
Read automatically from the paper; the printed page above is exact.
Show the answer and mark scheme
2(a)(i)[5]
2(a)(ii)[3]
2(a)(iii)[3]
2(a)(iv)[3]
2(b)(i)[5]
2(b)(ii)[4]
2(c)[3]
2(d)(i)[5]
2(d)(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.

