Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

(Object Oriented Java Program) Need to complete a program that uses stacks and simulates a game of war between two players where each player gets

(Object Oriented Java Program)

Need to complete a program that uses stacks and simulates a game of war between two players where each player gets 15 random numbers between 1 and 10. The 15 numbers are placed into their own "playing stack". Whoever has the higher number wins both numbers and store them in their own separate "storage stack". If the numbers are the same, the players play an additional two numbers from their "playing stack" and compare them two see who would win all the original numbers and the two new numbers (6 total if the original draw was a tie). When a player's "playing stack" is empty they continue playing with the numbers from their "storage stack". If a player wins all of the numbers, the game ends and they have won.

The program needs to output the information about the game and how it was played out. Also, it needs to ask the user what they want the "best of" amount to be (3, 5, or 7). The user should also be asked if they want to see the winner's info or if they just want to see how the game played out. Lastly, the user should be able to simulate another "best of" series if they would like, if not then they can stop the game.

Either the built in Java stack implementation or your own stack frame can be used to complete the program.

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Systems A Practical Approach To Design Implementation And Management

Authors: THOMAS CONNOLLY

6th Edition

9353438918, 978-9353438913

More Books

Students also viewed these Databases questions

Question

How do entrepreneurs differ from managers?

Answered: 1 week ago

Question

2. What type of team would you recommend?

Answered: 1 week ago