Last active
September 25, 2022 12:26
-
-
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. //
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
int weekday = 5; | |
int weekend = 9; | |
int optimalHours = 7 * 8; | |
int actualHours = weekday; | |
actualHours = actualHours + weekend * 2; | |
int solution = optimalHours - actualHours; | |
display(solution); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
*** 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. //