Back to Challenge Set 2

Code Challenge: Screen Time

Difficulty  

divider

The Brief

What they asked for
My phone tells me my daily average screen time and it never
means anything to me. I want to see it as hours per week,
and as a percentage of the time I am actually awake, because
I think that number will be more upsetting.

Write your requirements list before you write any code. Input, calculate, output, and anything you had to decide for yourself.


Notes

  • The phone reports minutes per day. The person wants hours per week. That is two conversions, not one.
  • Time I am actually awake is not defined anywhere in the brief. You have to decide what counts, and write that decision down in your requirements list.
  • Give the percentage to one decimal place, and remember every division here needs to be forced real — a whole number of minutes divided by a whole number of minutes-per-hour will truncate otherwise.

Sample Output

Sample Output
Daily screen time (minutes): 210
That is 1470 minutes per week
That is 24.5 hours per week
That is 21.9% of your waking hours

This sample assumes 16 waking hours a day. If you assumed something else your percentage will differ, and that is correct as long as your requirements list says what you assumed.


Submit

Your requirements list and your program file, named cc-screen-time.

Commence Challenge