At Westonci.ca, we provide reliable answers to your questions from a community of experts. Start exploring today! Discover precise answers to your questions from a wide range of experts on our user-friendly Q&A platform. Our platform offers a seamless experience for finding reliable answers from a network of knowledgeable professionals.

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