Write a client program for a MyTime class in Java which loops around getting strings from the user representing times and responding with a greeting such as “good morning” as appropriate. The user should enter the string “quit” to exit the program.

C++ Programming: From Problem Analysis to Program Design
8th Edition
ISBN:9781337102087
Author:D. S. Malik
Publisher:D. S. Malik
Chapter9: Records (struct)
Section: Chapter Questions
Problem 2PE
icon
Related questions
Question

Write a client program for a MyTime class in Java which loops around getting strings from the user representing times and responding with a greeting such as “good morning” as appropriate. The user should enter the string “quit” to exit the program.

EXAMPLE run of client:

USER: 2:07 pm

PROGRAM: good afternoon

USER: 10:71 am

PROGRAM: that’s not a valid time, please re-enter

USER: 14:30am

PROGRAM: that’s not a valid time, please re-enter

USER: 10:21am

PROGRAM: good morning

USER: 7:00 pm

PROGRAM: good evening

Expert Solution
steps

Step by step

Solved in 2 steps with 1 images

Blurred answer
Knowledge Booster
Developing computer interface
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
C++ Programming: From Problem Analysis to Program…
C++ Programming: From Problem Analysis to Program…
Computer Science
ISBN:
9781337102087
Author:
D. S. Malik
Publisher:
Cengage Learning
Programming Logic & Design Comprehensive
Programming Logic & Design Comprehensive
Computer Science
ISBN:
9781337669405
Author:
FARRELL
Publisher:
Cengage