IDNLearn.com connects you with a community of experts ready to answer your questions. Get comprehensive and trustworthy answers to all your questions from our knowledgeable community members.
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
We are happy to have you as part of our community. Keep asking, answering, and sharing your insights. Together, we can create a valuable knowledge resource. Your search for answers ends at IDNLearn.com. Thanks for visiting, and we look forward to helping you again soon.