A number game has two players. Random whole numbers are generated for each player. The numbers are compared and players are given points based on the result of the comparison. The two-dimensional (2D) array NumberGenerated[] stores each number generated for each player. The first dimension stores the player number and the second dimension stores the random whole numbers generated. The game is played as follows: • 100 random whole numbers between 1 and 6 inclusive are generated for player 1 and stored in the array. • 100 random whole numbers between 1 and 6 inclusive are generated for player 2 and stored in the array. • The first number generated for each player is compared and the player with the higher number is awarded 2 points. If the two numbers are the same, both players are awarded 1 point each. • The comparisons repeat for all 100 numbers generated. • The player with the higher total number of points is output as the winner. • If the players have the same total number of points, a new random whole number is generated for each player and compared. This is repeated until one player has a higher number than the other player. 2 points are added to that player's total number of points, making this player the winner. Write a program that meets the following requirements: • input and validate the names of the two players • generate 100 random whole numbers between 1 and 6 inclusive for each player and store them in the array NumberGenerated[] • calculate and store the total number of points for each player • output the name and total number of points for each player in descending order of total number of points. You must use pseudocode or program code and add comments to explain how your code works. You do not need to declare any arrays or variables; assume that this has already been done. All outputs must contain suitable messages.
- A number game has two players. Random whole numbers are generated for each player. The numbers are compared and players are given points based on the result of the comparison. The two-dimensional (2D) array NumberGenerated[] stores each number generated for each player. The first dimension stores the player number and the second dimension stores the random whole numbers generated. The game is played as follows: • 100 random whole numbers between 1 and 6 inclusive are generated for player 1 and stored in the array. • 100 random whole numbers between 1 and 6 inclusive are generated for player 2 and stored in the array. • The first number generated for each player is compared and the player with the higher number is awarded 2 points. If the two numbers are the same, both players are awarded 1 point each. • The comparisons repeat for all 100 numbers generated. • The player with the higher total number of points is output as the winner. • If the players have the same total number of points, a new random whole number is generated for each player and compared. This is repeated until one player has a higher number than the other player. 2 points are added to that player's total number of points, making this player the winner. Write a program that meets the following requirements: • input and validate the names of the two players • generate 100 random whole numbers between 1 and 6 inclusive for each player and store them in the array NumberGenerated[] • calculate and store the total number of points for each player • output the name and total number of points for each player in descending order of total number of points. You must use pseudocode or program code and add comments to explain how your code works. You do not need to declare any arrays or variables; assume that this has already been done. All outputs must contain suitable messages.[15]
Mark scheme
Marking points from the official mark scheme (Oct/Nov 2025). The mark or mark type is shown in brackets.
- [AO2, R1] input and validates the names of the players (iteration, input, output)
- [AO2, R2] generates the random numbers for each player. Calculates and store the number of points per player (iteration, totalling and selection)
- [AO2, R3] finds and outputs the name and score of the players in order with a suitable message taking into account a draw(iteration, selection and output)
- [AO3] Program fully commented
- [AO3] Suitable identifiers with names meaningful to their purpose
- [AO3] All data structures used have meaningful names
- [AO3] Program in logical order
- [AO3] Solution accurate and logically performs all tasks given
- [AO3] Solution meets all requirements
- Example pseudocode includes: iteration for player name input validation, random number generation loop, comparison logic, tie-breaking logic, outputting winner.
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 →