---
# System prepended metadata

title: Data of My Life
tags: [' doodle', mstu5003]

---

---
tags: mstu5003, doodle
---

# Data of My Life

---

```:javascript=

let name = "Yipu";
let sleepyLevel = 0;
let hungryLevel = 10; 
 
getTime(); // <<< 8am 
 
// Yipu usually gets up at 8am and starts her day with sleepyLevel = 0
 
let nyc = {
  lockdown: false,
  dangerLevel: 0,
}
 
// Because of the pandemic, NYC has been locked down for a while. She checks the status of the city once every morning.
 
function checkLockdown(city) {
   if (city.lockdown = true){
       workFromHome = true;
   } else {
   workFromHome = false;
   takeSubwayToTC();    
   } 
}

function checkDangerLevel(city){
 // Danger level (0-10) is calculated based on the number of new cases and the number of deaths in the previous day.
 if (dangerLevel <= 4){
     wearMask();
     return "Wear mask when going out for grocery!";
 }
} else if (dangerLevel <=7){
    wearMask();
    wearGloves();
    return "Wear mask and gloves when going out for grocery!";
} else {
    onlineGrocery();
    return "Stay at home and order grocery online!";
}

var numHungryChecked = 0; 
var numSleepyChecked = 0; 

// Check her hungry level (0-10) every hour
function checkHungryLevel() {
  if (hungryLevel >= 8) {
      eat();
  } else if (hungryLevel >=5) {
      snack();
  }else{
      work();
  }
  numHugryChecked++;
}

// Check her sleepy level (0-10) every hour
function checkSleepyLevel() {
  if (sleepyLevel < 7) {
      work();
  } else if (sleepyLevel <=9) {
      drinkCoffee();
  }else{
      sleep();
  }
  numSleepyChecked++;
}
