Part 1: Change operator (20%) in this exam, you will be asked to write a calculator program. The layout of the calculato
-
- Site Admin
- Posts: 899603
- Joined: Mon Aug 02, 2021 8:13 am
Part 1: Change operator (20%) in this exam, you will be asked to write a calculator program. The layout of the calculato
Part 3: Soft keyboard (45%) Create calculator keyboard using buttons. When the numerical button is clicked the selected operand will be updated according to the button value. There is a toggle button on the bottom of screen for user to switch operand (See screenshot below). When the equal button is clicked, the result TextView will be updated based on the current expression. If one of the operands is empty, a toast pop-up message should show on the screen, saying "The operand cannot be empty". Please also handle the issue of division by zero. Please also use a toast pop-up message to show a reasonable message. When the clear button is clicked, all the operands and result TextView should set back to the default (Remember to show the hint). How to Update Operand Value Mid A 63 CLEAR Result . . LEFT vide Right Operand 1 Mid 63 1 CLEAR @p Result GAT 0 11:47 Mid Aly 63 1 CLEAR 126 . 1 1 . RIGHT 2 7 1
Show Error Message When Empty Operand Mid 54 Mid = . CLEAR 98 = Result CLEAN •Right Operand S How to Clear TextViews AM I vide 53 1 3:13:22 45 1 Ave 54 . 3 CLEAR Left Operand . 3 •Right Operand Result I They My 2011 Result V RIGHT F 1 Right Operand
Part 4: Night Mode (15%) Add a switch on top of your screen called Night Mode. When night mode is on, the background color changed to dark gray (Color.DKGRAY). Remember to change all your text to white and hint to light gray except the soft keyboard. Below depicts the result when the switch is clicked. Mid Night Mode = AddSubcMily Divide Left Operand + Right Operand Left Operand Result " 4 1 CLEAR 2 D LEFT 1 Mid 1 Night Mode = CLEAR Sub Muly Divide Right Operand Result LEFT Mid Night Mode 58 = CLEAR Mpy Divide 174 RIGHT 3