Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

In Java: Program 2 Write a Java program to simulate a US time (hours and minutes) zone convertor based on the MST and destination state

image text in transcribed

In Java:

Program 2 Write a Java program to simulate a US time (hours and minutes) zone convertor based on the MST and destination state (among 50 states) that the user specifies. If the time difference spans a different day, use today/tomorrow/yesterday to simulate the day change (see sample below). Use JOptionPane or Scanner for input and output. Use a switch statement when checking the state. You can use the following look-up for writing down your selection statements. (Note: This is a simplified look-up table for 50 states). You can enter just the 2-character capital letter abbreviation for each state. Make sure you check for invalid input (ex. invalid time or state provided by user). Make sure output looks correct in all cases (Hint: Test with minutes less than 10). Input format: Enter the current hour in the mountain time zone (24-hour format): 23 Enter the minutes: 15 Enter the destination state for time conversion (2 capital letters): FL Output format: The current time in FL is 1:15 tomorrow Lesson to learn: In both the questions, your program chose to calculate one of the possible outputs based on the user input. What if the user provides an input that your program is unable to decide? For instance, what happens when the user types FI instead of FL

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

More Books

Students also viewed these Databases questions