PLEASE USE JAVA AND JFRAME GUI) Game rules: The game consists of a two-dimensional field of size m × n (game field). Each element of the game field is a button with a number assigned to it. Initialization of the game: • The numbers on the buttons of the game field are set to a random digit between 0 and 9 • The target value is displayed above the game field • The current sum of the numbers displayed on the buttons of the game field is printed below the game field • The number of moves to completion is displayed in the upper right corner above the game field. Playing: The first move is determined by the player by selecting any button (button A) on the game field. 1. The player is allowed to choose a second button (button B) located in the column or row of the previously selected button (A). 2. Upon selecting the second button (B), the value of button (A) is updated according to the following formula: A = (AoperationB)mod10. 3. The operation for the basic game will be +. 4. Decrement the number of moves and repeat from step 1, using the previously selected button (B) as the current button (A). Continue until the move counter is greater than 0. Goal of the game: The sum of the numbers on the buttons of the game field should be as close as possible to the target value displayed above the game field. If at the end of the move counter, the sum of the numbers on the buttons of the game field is greater than the target value, the player has lost the game. Task requires: (points in parentheses): • development of a user interface that allows playing (a different game field each time), with each new game launch we get a new arrangement (random)  • development of a user interface that saves the game field to a file (during play, allows selection of the game field arrangement from the file)  • game control menu (new game, setting the size of the game field, setting the number of moves, setting the target value)  • upgrade of the game control menu: the option to choose the difficulty level (easy, medium, hard), the set difficulty should affect the target value and the number of moves to completion.  • upon the expiration of the move counter, the graphical user interface should show the player if they have lost the game, or show the difference in points from the target value.  • current mathematical operation - add a component to the right side of the game field that displays the current mathematical operation. The current mathematical operation is used in step Playing 2 instead of the + operation. The current mathematical operation only applies for one move, and after the move a new mathematical operation is randomly selected that will be evaluated in the next move. Choose from the following mathematical operations: +, −, ∗, /  • upgrade of current mathematical operation - the next m mathematical operations are displayed on the right side of the game field, and the current operation is highlighted.  ATTENTION! • Pay attention to the correct use of basic elements of object-oriented programming - static methods are forbidden, define individual modules of the program as standalone classes.  • Pay attention to correct use of contracts!

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

(PLEASE USE JAVA AND JFRAME GUI)

Game rules:
The game consists of a two-dimensional field of size m × n (game field). Each element of
the game field is a button with a number assigned to it.
Initialization of the game:
• The numbers on the buttons of the game field are set to a random digit between 0
and 9
• The target value is displayed above the game field
• The current sum of the numbers displayed on the buttons of the game field is printed
below the game field
• The number of moves to completion is displayed in the upper right corner above the
game field.
Playing:
The first move is determined by the player by selecting any button (button A) on the
game field.
1. The player is allowed to choose a second button (button B) located in the column
or row of the previously selected button (A).
2. Upon selecting the second button (B), the value of button (A) is updated according
to the following formula: A = (AoperationB)mod10.
3. The operation for the basic game will be +.
4. Decrement the number of moves and repeat from step 1, using the previously selected
button (B) as the current button (A). Continue until the move counter is greater
than 0.
Goal of the game:
The sum of the numbers on the buttons of the game field should be as close as possible
to the target value displayed above the game field. If at the end of the move counter, the
sum of the numbers on the buttons of the game field is greater than the target value, the
player has lost the game.
Task requires: (points in parentheses):
• development of a user interface that allows playing (a different game field each time),
with each new game launch we get a new arrangement (random) 
• development of a user interface that saves the game field to a file (during play, allows
selection of the game field arrangement from the file) 
• game control menu (new game, setting the size of the game field, setting the number
of moves, setting the target value) 
• upgrade of the game control menu: the option to choose the difficulty level (easy,
medium, hard), the set difficulty should affect the target value and the number of
moves to completion. 
• upon the expiration of the move counter, the graphical user interface should show
the player if they have lost the game, or show the difference in points from the target
value. 
• current mathematical operation - add a component to the right side of the game
field that displays the current mathematical operation. The current mathematical
operation is used in step Playing 2 instead of the + operation. The current mathematical operation only applies for one move, and after the move a new mathematical
operation is randomly selected that will be evaluated in the next move. Choose from
the following mathematical operations: +, −, ∗, / 
• upgrade of current mathematical operation - the next m mathematical operations
are displayed on the right side of the game field, and the current operation is highlighted. 
ATTENTION!
• Pay attention to the correct use of basic elements of object-oriented programming -
static methods are forbidden, define individual modules of the program as standalone
classes. 
• Pay attention to correct use of contracts! 

Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 5 steps with 13 images

Blurred answer
Knowledge Booster
Array
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
  • SEE MORE 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