Answered step by step
Verified Expert Solution
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 FitbitDatacsv 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 hour period
You must report the max steps taken in one minute over the 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 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 ; 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 Resultscsv for mode write; this will either create a new csv
or overwrite an existing one
You must output two lines to Resultscsv and to the screen in the following
format:
o Line : Header line: Total Calories,Total Distance,Total Floors,Total
Steps,Avg Heartrate,Max Steps minutesSleep
o Line :
valueCalories,valueDistance,valueFloors,valueSteps,valueHeartrate,valu
eMaxactual minutesvalueSleepStart:valueSleepEnd
o Lines 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
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started