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

COMPREHENSIVE MICROSOFT OFFICE 365 EXCE
1st Edition
ISBN:9780357392676
Author:FREUND, Steven
Publisher:FREUND, Steven
Chapter10: Data Analysis With Power Tools And Creating Macros
Section: Chapter Questions
Problem 13EYW
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
COMPREHENSIVE MICROSOFT OFFICE 365 EXCE
COMPREHENSIVE MICROSOFT OFFICE 365 EXCE
Computer Science
ISBN:
9780357392676
Author:
FREUND, Steven
Publisher:
CENGAGE L
EBK JAVA PROGRAMMING
EBK JAVA PROGRAMMING
Computer Science
ISBN:
9781337671385
Author:
FARRELL
Publisher:
CENGAGE LEARNING - CONSIGNMENT
EBK JAVA PROGRAMMING
EBK JAVA PROGRAMMING
Computer Science
ISBN:
9781305480537
Author:
FARRELL
Publisher:
CENGAGE LEARNING - CONSIGNMENT