Skip to content

Instantly share code, notes, and snippets.

@surendra554
Last active September 25, 2022 12:26
Show Gist options
  • Save surendra554/310662cbe67f05dff18c0c6454929dc8 to your computer and use it in GitHub Desktop.
Save surendra554/310662cbe67f05dff18c0c6454929dc8 to your computer and use it in GitHub Desktop.
// The user estimates how much they sleep on a weekday/weekend day. The equation assume you need 8 hours sleep of a night. The user in this case sleep hours on weekday and 9 hours on a weekend. //
int weekday = 5;
int weekend = 9;
int optimalHours = 7 * 8;
int actualHours = weekday;
actualHours = actualHours + weekend * 2;
int solution = optimalHours - actualHours;
display(solution);
@surendra554
Copy link
Author

*** This program calculates the amount of sleep debt in a week. /*
// The user estimates how much they sleep on a weekday/weekend day. The equation assume you need 8 hours sleep of a night.
The user in this case sleep hours on weekday and 9 hours on the weekend. //

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment