Welcome to the Java Programming Forums

The professional, friendly Java community. 21,500 members and growing!

The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.

>> REGISTER NOW TO START POSTING

# Thread: Java Help (Penny Pitch Program) Someone please write this for me?

1. ## Java Help (Penny Pitch Program) Someone please write this for me?

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.

2. ## Re: Java Help (Penny Pitch Program) Someone please write this for me?

Did you have a question?