Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

//javaScript //this is the tracker function calcWalkCal(weight, distance) { return 0.3 * weight * distance; //requires weight in lbs, and distance in miles function calcRunCal(weight,

image text in transcribed

//javaScript //this is the tracker function calcWalkCal(weight, distance) { return 0.3 * weight * distance; //requires weight in lbs, and distance in miles function calcRunCal(weight, distance) { return 0.63 * weight * distance; } // speed is whatever units the user wants to use function calcSpeed(distance, time){ return distance/time; } exports.calcWalkcal calcWalkCal; exports.calcRunCal calcRunCal; exports.calcSpeed = calcSpeed; var tracker require("./tracker/tracker Service.js": var activities = [ {activity: "walking", weight: 17, distance: 3, time: 45}, activity: "running", weight: 200 , distance: 4, time: 40}, {activity: "running" weight: 175, distance: 5, time: 45}, {activity: "running", weight: 140, distanc e: 10, time: 240}] Use a loop to walk through the array, using the functions provided by in tracker module to process each item and print the data to the console in the following format: !!Need to use the functions from the tracker!! Activity: 1 walking Weight: 170 lbs. Speed: miles per hour Calories Burned: 135 ********* Activity: 2 running Weight: 200 lbs. Speed: 6miles per hour Calories Burned: 504 *****

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

SQL For Data Science Data Cleaning Wrangling And Analytics With Relational Databases

Authors: Antonio Badia

1st Edition

3030575918, 978-3030575915

More Books

Students also viewed these Databases questions