You must have played this 2 player game, in which there are 9 holes where one player mark Cross and the other Player places Ovals in the game and there are multiple situations at the end of the game in which are as follows. 1. Player 1 wins if he became able to mark 3 Cross in any of the row. 2. Player 1 wins if he became able to mark 3 Cross in any of the column. 3. Player 1 wins if he became able to mark 3 Cross in any of the diagonals of the holes. 4. Player 2 wins if he became able to mark 3 Ovals in any of the row. 5. Player 2 wins if he became able to mark 3 Ovals in any of the column. 6. Player 2 wins if he became able to mark 3 Ovals in any of the diagonals of the holes. 7. Match is drawn if all holes are filled but no one could win. Now what is requirement by your side, you have to write a Java program described below 1. Create 9 variables of type integer with names given below, which will act like the holes of the game. a. hole1, hole2, hole3, hole4, hole5, hole6, hole7, hole8 and hole9 2. Now take input in these 9 variables from user using the scanner but restrict them to input only 1 or 0, this 1 will represent the Cross and 0 will represent as Oval, if someone enters a number other than 0 and1, your program should give an appropriate message and then terminated. 3. When you have 9 numbers as 0 and 1, check all the situations and announce the results, either Player 1 wins or Player 2 wins or game is draw. Note: You must solve the above problem using Decision Structures. You are not allowed to use Loops. You do not have to enter any state where both player 1 and player 2 wins. You do not have to consider that condition when a player can win before going to all 9 values. You just have to follow the instructions where you have to declare winner after the 9 iterations.By using java language

Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
icon
Related questions
Question

You must have played this 2 player game, in which there are 9 holes where one player mark Cross and the other
Player places Ovals in the game and there are multiple situations at the end of the game in which are as follows.
1. Player 1 wins if he became able to mark 3 Cross in any of the row.
2. Player 1 wins if he became able to mark 3 Cross in any of the column.
3. Player 1 wins if he became able to mark 3 Cross in any of the diagonals of the holes.
4. Player 2 wins if he became able to mark 3 Ovals in any of the row.
5. Player 2 wins if he became able to mark 3 Ovals in any of the column.
6. Player 2 wins if he became able to mark 3 Ovals in any of the diagonals of the holes.
7. Match is drawn if all holes are filled but no one could win.
Now what is requirement by your side, you have to write a Java program described below
1. Create 9 variables of type integer with names given below, which will act like the holes of the game.
a. hole1, hole2, hole3, hole4, hole5, hole6, hole7, hole8 and hole9

2. Now take input in these 9 variables from user using the scanner but restrict them to input only 1 or 0,
this 1 will represent the Cross and 0 will represent as Oval, if someone enters a number other than 0 and1, your program should give an appropriate message and then terminated.
3. When you have 9 numbers as 0 and 1, check all the situations and announce the results, either Player 1
wins or Player 2 wins or game is draw.
Note:
You must solve the above problem using Decision Structures. You are not allowed to use Loops.
You do not have to enter any state where both player 1 and player 2 wins.
You do not have to consider that condition when a player can win before going to all 9 values.
You just have to follow the instructions where you have to declare winner after the 9 iterations.By using java language

 

Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 4 steps with 2 images

Blurred answer
Knowledge Booster
Probability Problems
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
Recommended textbooks for you
Database System Concepts
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education