Doodle Data Model Of My Life 31
```javascript=
let name = "Yichen An";
let weight = "67.5";
//Inorder to gain weight,I made this mini program Urging me to eat as planned
let TargetProtein = 135; //Standard Protein intake in gram for a 75kg male
let TargetCarbohydrate = 450; //Standard Carbohydrate intake in gram for a 75kg male
function checkProtein(intake){
if intake >=
targetProtein
return "Daily Protein Target Achieved";
else
targetProtein -= intake;
// calculate the reset of Protein I need to intake in a day
return "Daily Protein Target Incomplete! Go for an Extra meal";
} // This function used to cheak if I achieve the daily require fot protein
function checkCarbohydrat(intake){
if intake >=
targetCarbohydrat
return "Daily Carbohydrat Target Achieved";
else
targetCarbohydrat -= intake;
// calculate the reset of Carbohydrat I need to intake in a day
return "Daily Carbohydrat Target Incomplete! Go for an Extra meal";
} // This function used to cheak if I achieve the daily require fot Carbohydrat
let breakfast = {
intakeProtein = 15,
intakeCarbohydrate = 35
}
// Report my breakfast intake
let lunch = {
intakeProtein = 25,
intakeCarbohydrate = 155
}
// Report my lunch intake
let dinner = {
intakeProtein = 20,
intakeCarbohydrate = 150
}
// Report my dinner intake
totalProtein = dinner.intakeProtein + breakfast.intakeProtein + lunch.intakeProtein;
// Calculate sum of intake Protein
totalCarbohydrate = dinner.intakeCarbohydrate + breakfast.intakeCarbohydrate + lunch.intakeCarbohydrate;
// Calculate sum of intake Carbohydrate
checkProtein(totalProtein);
checkCarbohydrat(totalCarbohydrate);
let ExtraMeal = {
intakeProtein = 20,
intakeCarbohydrate = 150
}
checkProtein(ExtraMeal);
checkCarbohydrat(ExtraMeal);
//test after the extra meal
sleep();
```