Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Could use some help in SWIFT (xcode) with my boolean expresions/ if - else - if statements Lab-Control Flow 5. App Exercise-Target Heart Rate ##

Could use some help in SWIFT (xcode) with my boolean expresions/ if - else - if statements

image text in transcribed

Lab-Control Flow 5. App Exercise-Target Heart Rate ## App Exercise-Target Heart Rate These exercises reinforce Swift concepts in the context of a fitness tracking app 6 You decide that you want your fitness tracker to have a feature that helps users stay inside specified heart rate zones while they are working out. You'11 display a message to the user telling them to go a little faster to increase their heart rate if they are below the target tell them that they are spot on if they are in the target, and tell them to slow it down a little if they are over the target 8 Create constants 'isInTarget', 'sBelowTarget', and .sAboveTarget, that equal expressions that evaluate to whether or not currentHR is between the lower and upper bounds, below the lower bound, and above the upper bound, respectively. Then write an if-else-if statement that will print "You're right on track!" if the user is inside the target zone, "You're doing great, but try to push it a bit!" if the user is below the target zone, and "You 're on fire! Slow it down just a bit." if the user is above the target zone. 10 let targetLowerBound-12 11 let targetUpperBound 15 12 let currentHR=147 13 14 let isInTarget= 15 let sBelowTarget= 16 let sAboveTarget- 17 18 19 20 21 1: [Previous](@previous) I page 5 of 11 I [Next: Exercise - Switch Statements](@next) Expected initial value after Expected initial value after ' Expected initial value after

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

Medical Image Databases

Authors: Stephen T.C. Wong

1st Edition

1461375398, 978-1461375395

More Books

Students also viewed these Databases questions

Question

How might the lack of diversity at Roygbiv be explained?

Answered: 1 week ago

Question

Define organisation chart

Answered: 1 week ago

Question

What are the advantages of planning ?

Answered: 1 week ago

Question

Explain the factors that determine the degree of decentralisation

Answered: 1 week ago

Question

What Is acidity?

Answered: 1 week ago

Question

Explain the principles of delegation

Answered: 1 week ago