Question
This java is for multiple players (at least 2 players). It is a mathematics game that contains three different games and three different levels. There
This java is for multiple players (at least 2 players). It is a mathematics game that contains three different games and three different levels. There are their questions in each turn. The first question is addition the second question is subtraction the last one is mix calculation. Level1 is 1-10 calculation. Level 2 is 11-99. Level 3 is 100-199. Every time player gets a right answer can get one point. When they finish answer all questions, the game will compare their score and figure out the winner. Sample output is as follow. Please use loops method to do this question. Hi! welcome to Sweet House Math Puzzle! Please enter player1s name: XX Please enter player2s name: YY Nice to meet you XX and YY! Its XXs turnWe prepared 3 kinds of math puzzles for you. Which one would you like to play? Enter 1: easy Enter 2: median Enter 3: hard Enter 0: Quit the game. You choose: 1 There are 3 puzzles in the easy round: 1. Which box has candy? (2+1 = ?) Your answer is : 3 Bingo! You get 1 candy! Now you have 1/3 of candies. 2. Which box has candy? (2-2 = ?) You choose number: 0 Bingo! You get 1 candy! Now you have 2/3 of candies. 3. Which box has candy? (5+3-2 = ?) You choose number: 9 Sorry, its wrong. Now you have 2/3 of candies. Congratulations! You collected 2/3 candies in easy level. Do you want to try again( yes or no): No. Awesome! Now its YYs turn. We prepared 3 kinds of math puzzles for you. Which one would you like to play? Enter 1: easy Enter 2: median Enter 3: hard Enter 0: Quit the game. You choose: 3 There are 3 puzzles in the hard round: 1. Which box has candy? (122+145 = ?) Your answer is: 267 Bingo! You get 1 candy! Now you have 1/3 of candies. 2. Which box has candy? (123-123 = ?) You choose number: 0 Bingo! You get 1 candy! Now you have 2/3 of candies. 3. Which box has candy? (105+103-101 = ?) You choose number: 107 Bingo. Now you have 3/3 of candies. Congratulations! You collected 3/3 candies in hard level. Do you want to try again( yes or no): No. Congratulations! YY is the winner! Awesome! Hope to see you next time!
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