This question involves simulation of the play and scoring of a single-player video game. In the game, a player attempts to complete three levels. A level in the game is represented by the Level class.

public class Level {
   public boolean goalReached() { /* implementation not shown. */ }
   public int getPoints() { /* implementation not shown. */ }
   
// there may be instances variables, constructors, and methods that are not shown.
}
public class Game {
   private Level levelOne;
   private Level levelTwo;
   private Level levelThree;
   private boolean isBonus;
   
   public boolean isBonus()  { /* implementation not shown. */ }
   
   public int getScore()  { /* implementation not shown. */ }
   
   public void playRandom()  { /* implementation not shown. */ }
   
   public int playRandomManyTimes(int num)  { /* implementation not shown. */ }
   
// there may be instances variables, constructors, and methods that are not shown.
}

Part a

Write the getScore method which returns the score for the most recently played game. Each game consists of three levels. The score of the game is computed using the following methods.

image.png

Part b

Write playRandom method, which returns the random integer score range from 10 to 99.

Part c

You also need to write playRandomManyTimes method, which simulates the random play of num games and returns the highest game score earned. For example, if the four plays of the game that are simulated as a result of the method call playRandomManyTimes(4) earn scores of 75, 50, 90, and 20 hypothetically. Then the method should return 90. playRandomManyTimes method must use helper method playRandom