Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- This function stores whether the medicine has been taken on time, late, or not at all. If the current week is full, it is stored in the memory so that it can be reviewed later
- */
- // day of the week is 1 if meds are taken on time, 2 if late, 0 if not.
- int day_of_week = 0; // Sunday = 0, Monday = 1, … Saturday = 6
- int current_week [7];
- int previous_week [7];
- void log_medication (int status) { // status is 1 if taken on time, 2 if late, 0 if not
- ++day_of_week;
- if (day_of_week > 6) {
- //store current week in memory, then clear
- for (int i = 0; i < 7; i++){
- previous_week[i] = current_week[i];
- current_week[i] = 0;
- }
- day_of_week = 0;}
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement