Question
(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
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started