Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

LAB 4 Hello World (Max Grade 110pts) The following lab is intended to exercise your skills and understanding of labels, text fields, buttons and basic

LAB 4 Hello World (Max Grade 110pts)

The following lab is intended to exercise your skills and understanding of labels, text fields, buttons and basic connection of UI to code.

Create a new iOS project named HelloWorld(20 pts) Create two Labels

headLabel label that at the very top that displays your NAME

greetingLabel label under headLabel that is blank to start

(20 pts) Create a Text Field

nameTextField a text field that that is positioned under both labels and has placeholder text of Enter your name

(20 pts) Create two side by side Buttons

helloButton this will be the left button and it will read Say Hello

goodbyeButton this will be the right button and it will read Say Goodbye

(40 pts) Handle the button press

Validate the text field input, if theres no text in it write to the greetingLabel the message Please input your name below

If the helloButton is pressed, capture the name of the person from the text field and write Hello, [name] in the greetingLabel

If the goodbyeButton is pressed, write Goodbye, [name] in the greetingLabel

Extra Credit (10pts) Add a 3rd Label: timeStampLabel and display the current time in it every time the button is pressed assuming that there is a name in the text field HINT: use the Date() object.

Example output:

Max Smith

Hello, Max Smith

2:55 pm (you will need to do some formatting to get it to look like this)

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Visual C# And Databases

Authors: Philip Conrod, Lou Tylee

16th Edition

1951077083, 978-1951077082

More Books

Students also viewed these Databases questions

Question

2. Is it proper to speak of the reliability of a test" Why?

Answered: 1 week ago

Question

=+2 Is the decision sustainable in the long run?

Answered: 1 week ago

Question

=+1 Is the decision fair to employees?

Answered: 1 week ago