Your task is to develop a standard calculator in Java using BlueJ. Your implementation should use only following three packages: AWT, Swing and Util.Please implement the entire calculator within a single class. The GUI and the internal calculation logics should be separated under different methods. You may also choose to separate different parts of your code using sub-classes. This is what i should look like Please implement a GUI following the exact same layout as depicted in Fig. 1. In particular, the GUI should have the following components. • A display screen. The screen is to display the user inputs and the calculation outputs. The screen will display a digit “0” after the calculator is initialised. • A four-by-four grid with a total of 16 buttons. Among the 16 buttons, 10 of them correspond to the 10 digits, namely, 0, 1, 2, …, 9; four of them correspond to the four basic calculation operators, namely, addition (+), subtraction (-), multiplication (×) and division (÷); one is the equal sign (=), and; one stands for all clear (AC). The display screen will react to any user inputs immediately and display the corresponding information. For example, if the user wants to get the outcome of the following calculation: 102+8×5+69÷3-74=? 15 buttons will need to be clicked for a total of 16 times in the order as specified by Table 1 to complete this calculation and the right answer is 91. The information displayed by the display screen at each time a button is clicked is also given in Table 1. Please note that, the GUI of the calculator needs to follow the exact same layout as given by Fig. 1. However, you can choose the GUI size, button size, font, font style, font size and colour, etc., based on your own preference as long as the calculator is functioning as required. Using other layouts will be penalised

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

Your task is to develop a standard calculator in Java using BlueJ. Your implementation should use only following three packages: AWT, Swing and Util.Please implement the entire calculator within a single class. The GUI and the internal calculation logics should be separated under different methods. You may also choose to separate different parts of your code using sub-classes. This is what i should look like

Please implement a GUI following the exact same layout as depicted in Fig. 1. In particular, the GUI should have the following components. • A display screen. The screen is to display the user inputs and the calculation outputs. The screen will display a digit “0” after the calculator is initialised. • A four-by-four grid with a total of 16 buttons. Among the 16 buttons, 10 of them correspond to the 10 digits, namely, 0, 1, 2, …, 9; four of them correspond to the four basic calculation operators, namely, addition (+), subtraction (-), multiplication (×) and division (÷); one is the equal sign (=), and; one stands for all clear (AC). The display screen will react to any user inputs immediately and display the corresponding information. For example, if the user wants to get the outcome of the following calculation: 102+8×5+69÷3-74=? 15 buttons will need to be clicked for a total of 16 times in the order as specified by Table 1 to complete this calculation and the right answer is 91.

The information displayed by the display screen at each time a button is clicked is also given in Table 1.

Please note that, the GUI of the calculator needs to follow the exact same layout as given by Fig. 1. However, you can choose the GUI size, button size, font, font style, font size and colour, etc., based on your own preference as long as the calculator is functioning as required. Using other layouts will be penalised.

Order Button Clicked Display Screen
1
2
23
3
4
567899
10
11
12
13
14
15
16
1
ON +∞0 XL
0
2
8
5
+
6
9
1.3
7
4
=
1
10
102
+
8
X
5
+
6
69
÷
3
7
74
91
Transcribed Image Text:Order Button Clicked Display Screen 1 2 23 3 4 567899 10 11 12 13 14 15 16 1 ON +∞0 XL 0 2 8 5 + 6 9 1.3 7 4 = 1 10 102 + 8 X 5 + 6 69 ÷ 3 7 74 91
MyCalculator
789
5
6
2 3
DX
=
0
÷
x
4
1
AC 0
Fig. 1. Layout of the calculator
+
Transcribed Image Text:MyCalculator 789 5 6 2 3 DX = 0 ÷ x 4 1 AC 0 Fig. 1. Layout of the calculator +
Expert Solution
steps

Step by step

Solved in 3 steps

Blurred answer
Knowledge Booster
Running Time of Application
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