This question involves the implementation of a fitness tracking system that is represented by the StepTracker class. A S

Business, Finance, Economics, Accounting, Operations Management, Computer Science, Electrical Engineering, Mechanical Engineering, Civil Engineering, Chemical Engineering, Algebra, Precalculus, Statistics and Probabilty, Advanced Math, Physics, Chemistry, Biology, Nursing, Psychology, Certifications, Tests, Prep, and more.
Post Reply
answerhappygod
Site Admin
Posts: 899604
Joined: Mon Aug 02, 2021 8:13 am

This question involves the implementation of a fitness tracking system that is represented by the StepTracker class. A S

Post by answerhappygod »

This Question Involves The Implementation Of A Fitness Tracking System That Is Represented By The Steptracker Class A S 1
This Question Involves The Implementation Of A Fitness Tracking System That Is Represented By The Steptracker Class A S 1 (66.78 KiB) Viewed 85 times
This question involves the implementation of a fitness tracking system that is represented by the StepTracker class. A Step Tracker object is created with a parameter that defines the minimum number of steps that must be taken for a day to be considered active The StepTracker class provides a constructor and the following methods • add DailySteps, which accumulates information about steps, in readings taken once per day activeDeys, which returns the number of active days • averageSteps, which returns the average number of steps per day, calculated by dividing the total number of steps taken by the number of days tracked The following table contains a sample code execution sequence and the corresponding results. Statements and Expressions Value Returned (blank if no value) Comment StepTracker tr-new Step Tracker(10000); ): Days with at least 10,000 steps are considered active tractive Days: o No data have been recorded yet tr.averageSteps) 0.0 When no step data have been recorded, the averageSteps method returns 0.0. . tr.addDaily Steps(9000); This is too few steps for the day to be considered active. . - traddDailySteps(5000); This is too few steps for the day to be considered tractive Days: No day had at least 10,000 steps. tr.averageSteps: 7000.0 The average number of steps per day is (14000 / 2) tr.acdDaily Steps(13000): This represents an active day tractive Days: 1 of the three days for which step data were entered, one day had at least 10,000 steps. tr.averageSteps: 9000.0 The average number of steps per day is (27000/3). . M tr.addDailySteps(2000): This represents an active day tr.addDailySteps(1111): This is too few steps for the day to be considered active. tractiveDays: 2 of the five days for which step data were entered two days had at least 10,000 steps. traverageSteps 10222.2 The average number of steps per day is (51111/5).
Join a community of subject matter experts. Register for FREE to view solutions, replies, and use search function. Request answer by replying!
Post Reply