Question: Create an XCode 11 project. o Use the Single View App o Specify the project name as: MW01_lastName_firstName where lastName is the part of your
Create an XCode 11 project.
o Use the Single View App o Specify the project name as:
MW01_lastName_firstName where lastName is the part of your name that OSU considers to be your last name, and firstName is your first name. (This is the product naming convention we will use for all weekly assignments.)
2. In your Main.stoyboard o Add a label.
o 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 - to clear the functions/contents in the label (AC) (1 button) o In your ViewController.swift file add appropriate outlets and actions to your above created objects.
o 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.
o 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 =
3. Change the background color of the label depending on the result o If the result is negative, change the background color of the label to black.
o 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 red.
o 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 red.
o 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 invisible.)
When the result is 0, the background color can be different depending on the situation. If the result is 0 by calculation, the background color stays/turns to the same default color that you choose for a positive numbered result. The background color of label stays/changes to red only when the result is 0 by an error.
Make your app more creative and attractive with different buttons, styles and colors.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
