Write a Java program that asks a user to enter a time of the day (integer number from 0 to 24). If time is between 0 and 5, the program prints "Good night!". If time is less than 10:00, then print “Good morning!”. If time is less than 20:00, then print “Good day!”, otherwise it prints “Good evening!”.

EBK JAVA PROGRAMMING
9th Edition
ISBN:9781337671385
Author:FARRELL
Publisher:FARRELL
Chapter2: Using Data
Section: Chapter Questions
Problem 15PE
icon
Related questions
Question

Write a Java program that asks a user to enter a time of the day (integer number from 0 to 24).  If time is between 0 and 5, the program prints "Good night!". If time is less than 10:00, then print “Good morning!”. If time is less than 20:00, then print “Good day!”, otherwise it prints “Good evening!”.

Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 4 steps with 2 images

Blurred answer
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
EBK JAVA PROGRAMMING
EBK JAVA PROGRAMMING
Computer Science
ISBN:
9781337671385
Author:
FARRELL
Publisher:
CENGAGE LEARNING - CONSIGNMENT