Question
- All the outputs should change according to the entered values. - Outputs should EXCATLY match mine. - Not allowed to use the input function
- All the outputs should change according to the entered values.
- Outputs should EXCATLY match mine.
- Not allowed to use the input function
Write a program that accepts hours of sleep for 5 nights. In addition to the 5 nights of hours of sleep, input an age as the sixth value. Add a conditional statement that checks whether or not a person is an adult(18 or older), as this application is only for adults. If the user is not an adult, the program should display a message. The program should determine whether an adult sleeps too much, too little, or in the normal range according to the sleep foundation(https://www.sleepfoundation.org/press-release/national-sleep-foundation-recommends-new-sleep-times). Note that the ranges are different for younger and older adults. Your program should cover all ranges.
Input:
a) python C:\Users eda\DataProgramming\M3\assign3-6.py 8 9 7.5 6 8.5 66
b) python C:\Users eda\DataProgramming\M3\assign3-6.py 8 9 7.5 6 8.5 15
c) python C:\Users eda\DataProgramming\M3\assign3-6.py 10 11 9.5 8 10.5 27
Output:
a) Average: 7.8
Sleep type: normal
b) You must be an adult to participate.
c) Average: 9.8
Sleep type: too much
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started