Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

- 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

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Concepts of Database Management

Authors: Philip J. Pratt, Joseph J. Adamski

7th edition

978-1111825911, 1111825912, 978-1133684374, 1133684378, 978-111182591

More Books

Students also viewed these Databases questions

Question

What is block ownership? How does it affect corporate governance?

Answered: 1 week ago

Question

10. Microsoft Corporation

Answered: 1 week ago

Question

4. EMC Corporation

Answered: 1 week ago