new UserRepository(data);
-
Methods:
getUserData=> Given a user’s ID, what is their user data? (Grab object based onuserData[i].id)compareStepGoal=> The average step goal amongst all users (Iterate through all objects to grabdailyStepGoalthen get sum & divide by total number of users => No hard coding)
new User(userData);
-
A User represents a single user
{ "id": integer, "name": "first last", "address": "# + street, city ZZ XXXXX-XXXX", "email": "email@site.com", "strideLength": float, "dailyStepGoal": integer, "friends": [int, int, int] } -
Parameter: take in a
userDataobject
Methods:
getUserName(Return a user’s first name only => name is currently stored as first + last string within an object)
new HydrationRepository(data);
Methods:
getUserHydrationData
new UserHydration(hydrationData);
{ "userID": integer, "date": "YYYY/MM/DD", "numOunces": integer }
- For a user (identified by their userID - this is the same for all methods requiring a specific user’s data),
Methods:
calcAvgDailyOuncesthe average fluid ounces consumed per day for all time
findDailyOunceshow many fluid ounces they consumed for a specific day (identified by a date) => I'm assuming we should save this in an array or maybe make an object for daily user data (hydration, sleep, & activity) that we can iterate through
calcDailyOunceshow many fluid ounces of water consumed each day over the course of a week (7 days) - return the amount for each day
new SleepRepository(data);
Methods:
getUserSleepData
calcAvgQualitythe average sleep quality
calcQualityLeadersFind all users who average a sleep quality greater than 3 for a given week (7 days) - you should be able to calculate this for any week, not just the latest week
findTopSleeperFor a given day (identified by the date), find the users who slept the most number of hours (one or more if they tied)
new UserSleep(sleepData);
{ "userID": integer, "date": "YYYY/MM/DD", "hoursSlept": float, "sleepQuality": float }
Methods:
calcAvgTotalHrs(identified by their userID), the average number of hours slept per day
calcAvgTotalQualitytheir average sleep quality per day over all time
findDailyHrshow many hours they slept for a specific day (identified by a date)
findDailyQualitytheir sleep quality for a specific day (identified by a date)
findWeeklyHrshow many hours slept each day over the course of a given week (7 days) - you should be able to calculate this for any week, not just the latest week => [array]
findWeeklyQualitytheir sleep quality each day over the course of a given week (7 days) - you should be able to calculate this for any week, not just the latest week => [array]
new ActivityRepository(data);
Methods:
getUserActivityData
calcAvgStairsstairs climbed for a specified date
calcAvgStepssteps taken for a specific date
calcAvgMinminutes active for a specific date
new UserActivity(activityData);
{ "userID": integer, "date": "YYYY/MM/DD", "numSteps": integer, "minutesActive": integer, "flightsOfStairs": integer }
Methods:
calcMilesWalkedFor a specific day (specified by a date), return the miles a user has walked based on their number of steps (use their strideLength to help calculate this)
calcActiveMin(identified by their userID) how many minutes were they active for a given day (specified by a date)?
calcWeeklyAvgMinhow many minutes active did they average for a given week (7 days)?
checkStepsReacheddid they reach their step goal for a given day (specified by a date)?
findStepsExceededfind all the days where they exceeded their step goal
findStairRecordfind their all-time stair climbing record





