sleepCheck - need help


We have given instructions to write a code with "Return" and "if else".
Write a function named sleepCheck that takes the parameter numHours
Inside the function, write an if statement where if the number of hours of sleep is greater than or equal to 8, the computer will return "You're getting plenty of sleep! Maybe even too much!";.
Otherwise (else) if the number of hours of sleep is less than 8, have the computer return "Get some more shut eye!";
Then call the function with different hours of sleep

Call the function with 10 hours of sleep, like this: sleepCheck(10);
Call the function with 5 hours of sleep.
Call the function with 8 hours of sleep.

Please find my attached snapshot.
The expected output is printed still giving error. Not sure what am I missing. Please help

Return Keyword

Check your text strings against the instructions (and error message). They must match.


Thanks. It worked.
You are right. As you said, there was some text mismatch.


This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.