Westonci.ca offers quick and accurate answers to your questions. Join our community and get the insights you need today. Explore thousands of questions and answers from a knowledgeable community of experts on our user-friendly platform. Discover detailed answers to your questions from a wide network of experts on our comprehensive Q&A platform.
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
Thanks for stopping by. We are committed to providing the best answers for all your questions. See you again soon. Your visit means a lot to us. Don't hesitate to return for more reliable answers to any questions you may have. Thank you for using Westonci.ca. Come back for more in-depth answers to all your queries.