Westonci.ca offers fast, accurate answers to your questions. Join our community and get the insights you need now. Get immediate and reliable solutions to your questions from a community of experienced professionals on our platform. Connect with a community of professionals ready to help you find accurate solutions to your questions quickly and efficiently.

Write a program noonsnooze.java that takes an integer command-line argument snooze and prints the time of day (using a 12-hour clock) that is snooze minutes after 12:00pm (noon).

Sagot :

A program noonsnooze.java that takes an integer command-line argument snooze and prints the time of day (using a 12-hour clock) that is snooze minutes after 12:00pm (noon) is given below:

The Code

public class NoonSnooze

{

public static void main(String[] args)

{

 int snooze = Integer.parseInt(args[0]);

 int hour = 12 + (snooze / 60);

 int minutes = 00 + snooze % 60;

 

 

 String ampm;

 if(hour%24 < 12) ampm="pm";

 else    ampm="am";

 

 hour=hour%12;

 if (hour==00) hour=12;

 

 String time = hour + ":" + minutes + " " +  ampm;

 System.out.println(time);

 

}

}

Read more about programming here:

https://brainly.com/question/23275071

#SPJ1