Healthy sleep

Report a typo

Ann watched a health TV program and learned that oversleeping is as bad for your health as not getting enough sleep. She decided to follow TV recommendations and keep track of how many hours she spends sleeping.

You are given three numbers: A A , B B and H H . According to TV, one should sleep at least A A hours per day, but no more than B B hours. H H is how many hours Ann sleeps.

Task: If Ann sleeps less than A A hours, print "Deficiency". If she sleeps more than B B hours, print "Excess". If her sleep fits the recommendations, print "Normal".

Input format: three numbers A A , B B , H H , where A A is always less than or equal to B B .

Tip: 1. Keep in mind that tests are case sensitive: "excess" or "EXCESS" is not correct.

2. Think carefully about all the conditions. Pay attention to the conditional operators: distinguish between < \lt and \le ; > \gt and \ge .

Sample Input 1:

6
10
8

Sample Output 1:

Normal

Sample Input 2:

7
9
10

Sample Output 2:

Excess

Sample Input 3:

7
9
2

Sample Output 3:

Deficiency
Write a program in Java 17
import java.util.Scanner;

class Main {
public static void main(String[] args) {
Scanner scanner = new Scanner(System.in);
// start coding here
}
}
___

Create a free account to access the full topic