Question: Intro to JAVA please see below: ___________________________________________________ Complete the given program TimeComparison that reads the times for two events, such as 3 30 pm and

Intro to JAVA please see below:

___________________________________________________

Intro to JAVA please see below: ___________________________________________________ Complete the given program TimeComparison

Complete the given program TimeComparison that reads the times for two events, such as 3 30 pm and 11 20 am. Determine whether the first event occurs before the second event, at the same time, or after the second event. Print "Before", "Same", or "After". This program does not involve any loop Hint: You may make decisions based on suffixes first, then hours, and then minutes. import java.util.Scanner: public class TimeComparison public static void main (String [] args) Scanner in - new Scanner (System.in); // Reads in two event times, such as 11 20 am or 3 30 pnm System.out.print ("First event time: ") int hourl - in.nextInt ) int mini -in.nextInt ): String suffix1 in.next(); System.out.print("Second event time: ") int hour2in.nextInt ) int min2 in.nextInt ) String suffix2in.next ); // Your work goes here. ) // main // TimeComparison Here are the expected outputs from several runs of this program First event time: 10 30 am Second event time: 1 20 pm before First event time: 1 30 pm Second event time: 2 25 pm before First event time: 1 30 pm Second event time: 1 45 pm before First event time: 1 25 pm Second event time: 1 25 pm

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!