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.
✓ Correct Answer
The correct answer is —. This question tests the candidate's understanding of programming within the Computer Sciencesyllabus. The examiner's mark scheme requires...
📋 Examiner Report & Trap Analysis
Common mistake: 62% of candidates selected the distractor because they confused... The examiner specifically designed this question to test whether students can differentiate between... To secure full marks, candidates must demonstrate...
Unlock the Examiner's Answer
Sign up for free to reveal the correct answer, the official mark scheme breakdown, and the examiner trap analysis for this question.
Sign Up Free to Unlock →Join thousands of Cambridge students already using Oracle Prep