subject

In your Main. storyboard Add a
Using stack view, add 17 buttons:
Numbers 0 through 9 (10 buttons)
Decimal point (.) (1 button)
Operations (+, -, *, /) (4 buttons)
Equality sign (=) (1 button)
All clear (AC) to clear the functions/contents in the label (1 button)
In your ViewController. swift file add appropriate outlets and actions to your above created objects.
All the buttons should have appropriate text and action. For example: Numbers should append appropriate number to the label, Equality sign should replace the label content with the result.
Your label must show the entire expression before the result is calculated (i. e. before the equality button is tapped.)
For example: With this sequence of button taps, 1, + and 2, your label must show "1", "1+" and "1+2" for each corresponding button tap. The label must be replaced with "3" when tapped on =.

Change the background color of the label depending on the result
If the result is negative, change the background color of the label to
Since you will be converting the label string into an expression and perform the calculation, you will get errors for improper expressions. Handle that error, set the result in the label to 0 and change the background of the label to
For a calculated non-negative result, the background color of the label should be a default color (same color when the app is launched). The default is usually white, but you can choose any color other than black and
Make sure the text within the label is visible when the background color is changed (i. e. change the text color appropriately if the text is )

ansver
Answers: 2

Other questions on the subject: Computers and Technology

image
Computers and Technology, 21.06.2019 19:40, Dogtes9667
Consider the following generator matrix: g= (1 0 0 0 1 0 0 0 1 1 1 1 1 0 1 1 1 0) find all the codewords generated by this generator matrix. determine the number of errors that this code will detect. determine the number of errors that this code will correct. prove that a linear code's minimum weight is equivalent to its minimum distance. that is, where c is a linear code, dist(c) = wh(c)
Answers: 1
image
Computers and Technology, 22.06.2019 10:40, pbarbee3034
Nims is applicable to all stakeholders with incident related responsibilities. true or false
Answers: 1
image
Computers and Technology, 22.06.2019 22:30, jacob7542
The qwerty keyboard is the most common layout of keys on a keyboard
Answers: 3
image
Computers and Technology, 23.06.2019 04:31, mjweed3381
Cloud computing service providers manage different computing resources based on the services they offer. which resources do iaas and paas providers not manage? iaas providers do not manage the for the client, whereas paas providers usually do not manage the for their clients. iaas- storage server operating system network paas- applications interafce storage vertualiation
Answers: 2
You know the right answer?
In your Main. storyboard Add a
Using stack view, add 17 buttons:
Numbers 0 through 9 (1...

Questions in other subjects:

Konu
Mathematics, 21.06.2019 13:50
Konu
Mathematics, 21.06.2019 13:50