Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

This program does not require any user input! However, you will need to display some results to the screen! - You must open FitbitData .

This program does not require any user input! However, you will need to display some
results to the screen!
- You must open FitbitData.csv for mode read; check for success
- You must read each record in the file as a string, one line at a time; if the
record does not belong to the target patient, then it should be discarded
- You must parse each record into the corresponding fields, and store into the
FitbitData array; note: not all fields have values, some are empty or null;
if some of the fields are empty or null, then you must perform data cleansing
and insert values to construct a record that is consistent with the others; the
data inserted should not represent valid values
- You must compute the total calories burned, distance walked in miles, floors
walked, and steps taken
- You must compute the average heartrate over the 24-hour period
- You must report the max steps taken in one minute over the 24-hour period; if
there are multiple minutes throughout the day where the max is discovered,
then you must report each minute that matches the max in the 24-hour period
- You must report the longest consecutive range of poor sleep; a range is defined
as one or more consecutive minutes where the sleepLevel >1; the poorest
sleep is not based on the length of the range, but the sum of the sleep levels in
the range; the max sum of the ranges is considered the poorest sleep (report
the starting and ending minutes of range)
- You must open Results.csv for mode write; this will either create a new .csv
or overwrite an existing one
- You must output two lines to Results.csv and to the screen in the following
format:
o Line 1: Header line: Total Calories,Total Distance,Total Floors,Total
Steps,Avg Heartrate,Max Steps (minute(s)),Sleep
o Line 2:
valueCalories,valueDistance,valueFloors,valueSteps,valueHeartrate,valu
eMax(actual minute(s)),valueSleepStart:valueSleepEnd
o Lines 3 N: the filtered, deduped, and cleansed data in the original
FitbitData.csv format

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

More Books

Students also viewed these Databases questions