Computers and Technology

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 )

answer
Answers: 2

Other questions on the subject: Computers and Technology

image
Computers and Technology, 22.06.2019 14:50, williamsgregg5214
Drag each label to the correct location on the image list the do’s and don’ts of safeguarding your password. a. keep yourself logged in when you leave your computer. b. don’t write your password down and leave it where others can find it. c. share your password with your friends. d.each time you visit a website, retain the cookies on your computer. e. use a long password with mixed characters.1. do's 2. don'ts
Answers: 2
image
Computers and Technology, 22.06.2019 16:30, sayedaly2096
What type of file does a cookie place on web site visitors' computers so that web site managers can customize their sites to their visitors' preferences?
Answers: 1
image
Computers and Technology, 22.06.2019 17:30, jonquil201
Where would you click to edit the chart data?
Answers: 1
image
Computers and Technology, 22.06.2019 21:30, mima851
Elements such as fonts colors visual structure graphics and the interface of a web page should complement each other to ensure blank
Answers: 3
Do you know the correct answer?
In your Main. storyboard Add a
Using stack view, add 17 buttons:
Numbers 0 through 9 (1...

Questions in other subjects:

Konu
Mathematics, 30.11.2021 20:50