Directions: Write a program to play the Penny Pitch game. The layout of the board is two-dimensional as follows:
Write a program to play the Penny Pitch game. The layout of the board is two-dimensional as follows:
1 1 1 1 1
1 2 2 2 1
1 2 3 2 1
1 2 2 2 1
1 1 1 1 1
In the game, a player tosses several pennies on the board aiming for the number with the highest value and a running total is kept. When the game starts, prompt the user for the number of pennies they have to toss (minimum of five and a maximum of 25). Make sure to check for a valid number of tosses. At the end of the game, sum the total of the tosses and return the total. Also display the number of times a penny landed on a 1 spot, 2 spot, and 3 spot. The program should perform the following steps each time the user still has a penny to toss:
Generate two random numbers for the row and column of the toss
Add the number at this position to a running total
Update the count for the number of times a penny lands on 1, 2 and 3 spots
Display the board, replacing the numbers with Ps where the pennies land.