Question

App Exercise -Workout Types Note These exercises reinforce Swift concepts in the context of a fitness tracking app. You fitne
Write simple functions called describeRun(runningWorkout:) and describeSwim(swimminghorkout:) that take a Run object and a Sw
App Exercise -Workout Types Note These exercises reinforce Swift concepts in the context of a fitness tracking app. You fitness tracking app may allow users to track different kinds of workouts. When architecting the app types of workout dasses inherit. Below are three classes. Workout igthe base class with time and distance properties, and Run and Swim are subclasses that add more specific properties to the Workout class. you may decide to have a Workout base class from which other Also provided is a workouts array that represents a log of past workouts. You'l use these classes and the array for the exercises below.
Write simple functions called describeRun(runningWorkout:) and describeSwim(swimminghorkout:) that take a Run object and a Swim object, respectively Neither should return values. Each function should print a descriptipn of the workout, including the run's cadence or the swim's stroke. Time is represented in seconds, distance is represented in meters, and cadence is represented in steps per minute. Now loop through each workout in workouts and, using type casting, call either describeRun ( runningWorkout: ) or describeSwim ( swimmingWorkout:) on each. Observe what is printed to the console.
0 0
Add a comment Improve this question Transcribed image text
Answer #1

ANSWER Styuct Work out let Start Time Doube lee end Time: Double init? (start Time : Doude, end Time Double) endTime- start Tprint Lobj 1) print (obja) Bample output:- nil sealftptay ground. wokoutC optional Startfime 8&o0.0, endrime : a8900.0)) irIr

Add a comment
Know the answer?
Add Answer to:
App Exercise -Workout Types Note These exercises reinforce Swift concepts in the context of a fitness tracking app...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • App Exercise -Workout Types Note These exercises reinforce Swift concepts in the context of a fitness...

    App Exercise -Workout Types Note These exercises reinforce Swift concepts in the context of a fitness tracking app. You fitness tracking app may allow users to track different kinds of workouts. When architecting the app types of workout dasses inherit. Below are three classes. Workout igthe base class with time and distance properties, and Run and Swim are subclasses that add more specific properties to the Workout class. you may decide to have a Workout base class from which other...

  • reinforce swift concept context of fitness tracking app

    ****** Result for Image/Page 1 ****** App Exercise Target Heart Rate Note These exercises reinforce Swift concepts in the context of a fitness tracking app. 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'll 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...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT