Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Write a Java Code.As you know these last couple of months, we have new quarantine, lockdown rules. These rules are applied to different age group

Write a Java Code.As you know these last couple of months, we have new quarantine, lockdown rules. These rules are applied to different age group and they have different period of time of the specific day that they can go out. Write a code which determines if the user can go out or not and if they can how much time they have to spend outside. Program will read four inputs in the following order: the age, the day of week, hour of time, and minutes of time.

Note: the hour format should be 1-24. If the day is Sunday or Saturday: print You cant go out. In weekdays, if the age is under 20 or above 65, you can go out between 13:00 -17:00. If the age is between 20 and 65, you can go out between 5:00- 21:00.

Input Format

Take 4 input value from the user: age, day of week, hour of time, and minutes of time.

Constraints

There is no constraint

Output Format

Print if the user can go out or not and the left time to be outside.

The output format must be as the following structure: You cant go out! You can go out and you have 1 hours and 1 minutes to be outside!

Sample Input 0

25 Monday 14 50 

Sample Output 0

You can go out and you have 6 hours and 10 minutes to be outside!

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

DATABASE Administrator Make A Difference

Authors: Mohciine Elmourabit

1st Edition

B0CGM7XG75, 978-1722657802

More Books

Students also viewed these Databases questions