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

Another question on Computers and Technology

question
Computers and Technology, 22.06.2019 10:30
Aconstruction company is creating a powerpoint presentation describing how they calculate costs during each construction step. they plan to email this presentation to clients. the individual clients will be watching the presentation slide show on their own personal computers. what is the most important formatting step the company should take to make the text readable and pleasing to the eye?
Answers: 2
question
Computers and Technology, 22.06.2019 19:20
Write a program that reads a file consisting of students’ test scores in the range 0–200. it should then determine the number of students having scores in each of the following ranges: 0–24, 25–49, 50–74, 75–99, 100–124, 125–149, 150–174, and 175–200. output the score ranges and the number of students. (run your program with the following input data: 76, 89, 150, 135, 200, 76, 12, 100, 150, 28, 178, 189, 167, 200, 175, 150, 87, 99, 129, 149, 176, 200, 87, 35, 157, 189.)
Answers: 3
question
Computers and Technology, 23.06.2019 09:30
:you areto design the controller for alight that functions both as an ordinary light and also as a motion activated light and alarm. a.if the manual switch s is on, then the light l is on. b.besides the manual switch, there is a motion detector, m1, which activatesthis light.c.if motion is detected but the light is on anyway because s is on, only then a secondoutput a, an alarm, is turned on. d.the disable switch, d, disables the motion activated light and alarmbut leaves manual control operation of the light using switch s.(i)read the problem statement and clearly identify the inputs and outputs for the circuit you are designing. (ii)create the truth table for this system; include the light, alarm, switch, disable, and the motion sensor.(iii)draw a schematic of this system.
Answers: 1
question
Computers and Technology, 24.06.2019 21:30
Computer security/cybersecurity1) each of the following code fragments contains a number of security vulnerabilities. for each fragment, identify these security vulnerabilities and, for each vulnerability, discuss at least one way that it could be improved. note that in your discussion of how each vulnerability could be improved, you do not need to re-write a new version of the program in c; simply discuss your solution, either in pseudocode or in 1-2 sentences.a) /* file descriptor leak */#include #include int main(int argc, char *argv[]){ char *filepath = argv[0]; char *shellpath = argv[1]; file *passwords; passwords = fopen(filepath, "r"); /* read the password and do something with it */ /* . . */ /* fork and execute alternative shell */ execl(shellpath, "shell", null); }b)#include /* assume the following function is written for an electronic storefront. the user will enter the id of the item to be ordered, as well as the quantity of units that they would like to purchase. the program will then lookup the price for the price for the item using a predefined function, and return the total cost of the order.*/int gettotalcost(){ char itemid[9]; int price, unitsordered, cost; printf(" enter the 9-digit id of the item to be ordered: "); scanf("%s", & itemid); /* lookup the price according to the itemid */ price = getpricebyid(itemid); printf(" enter the quantity of units to be ordered: "); scanf("%d", & unitsordered); cost = price * unitsordered; return cost; }c)#include /* the following function is intended to return a user's full name by concatenating the user's first and last name into a single string and then returning that string. */char *getfullname(char *firstname, char *lastname, int max_len){ char fullname[max_len]; strcpy(fullname, firstname); strcat(fullname, " "); strcat(fullname, lastname); return fullname; }d)#include /* the following code snippet runs through the list of cli arguments entered and displays them to the console. */int main(int argc, char *argv[]){ int i; printf("you've entered the following arguments: "); for(i = 0; i < argc; i++){ print(argv[i]); printf("\n"); } /* */}
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
question
Mathematics, 16.03.2020 19:17
question
History, 16.03.2020 19:17
question
World Languages, 16.03.2020 19:17
question
Mathematics, 16.03.2020 19:18
Questions on the website: 13722363