Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

C language Source: http://eecs.wsu.edu/~aofallon/cpts122/progassignments/FitbitData.csv C Program PLZ DONT COPY THE ANSWER FROM THIS WEB I already know them, I really need new answer!!!! Fitbit is

C language
Source:
http://eecs.wsu.edu/~aofallon/cpts122/progassignments/FitbitData.csv image text in transcribed
C Program PLZ DONT COPY THE ANSWER FROM THIS WEB I already know them, I really need new answer!!!! Fitbit is a company that builds wearable technology devices that track various activities. The devices have sensors that measure number of steps and distance walked, heart rate, sleep quality, floors climbed, and calories burned. In this assignment, you will analyze data that was generated from a real Fitbit device. The data is stored in a comma-separated values (csv) file that you will find at: http:/leecs.wsu.edu/-aofallon/cpts 122/progassignments/FitbitData.csv. A csv file stores data as plaintext in tabular form. Each row in the file is considered a record. Each record consists of fields separated by commas, In particular, you will analyze 24 hours of data. Each record in the "FitbitData esv" represents one minute of data and consists of seven fields. These include the following: Calories Distance (in miles) Floors Heartrate Sleep level What data structures are required? In this assignment, you must define a C struct to store each of the Fitbit data fields as follows: typedef struct fitbit hari double calories double distance unsigned int floors; unsigned int heartRate: unsigned int steps; Sleep sleepLevel; FitbitData The type Sleep is enumerated and must be defined as follows: typedef enum sleep NONE = 0, ASLEEP = 1, AWAKE 2. REALLYAWAKE = 3 sleep; You must also define an array of FithitData that can store 24 hours of minute data. Hence, you must declare an array of size 1440. You have the freedom to decide on other data structures and variables that you need for the assignment. What are the otber requirements? 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 using fgets(0 You must parse each record using strtokO from into the corresponding fields, and store into the FitbitData array; note: not all fields have values, some are "empty" or null You must compute the total calories burned, distance walked in miles, floors walked, and steps taken You must compute 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 report the one that is the latest 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 esv or overwrite an existing one You must output two lines to "Results.csv and to the screen in the following format: Line I: Total Calories,Total Distance, Total Floors,Total Steps,Avg Heartrate,Max Steps Sleep Line 2: You must close "FitbitData csvand "Results.csv

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

Modern Datalog Engines In Databases

Authors: Bas Ketsman ,Paraschos Koutris

1st Edition

1638280428, 978-1638280422

Students also viewed these Databases questions