Question: Problem # 1 ( 5 marks ) Write an application that reads values representing a time in seconds and then prints the equivalent time in

Problem #1(5 marks)
Write an application that reads values representing a time in seconds and then prints the equivalent time in hours, minutes, and seconds. (For example, 5322 seconds is equivalent to 1 hour, 28 minutes, and 42 seconds.)
/Write a header file comment here. It should look like:
1****
Title: CMPT 166 Assignment #1 Problem #1
File: Time_Conversion java
Description: To convert seconds to hours, minutes, and seconds
@author (your name)
@version (optional)
Student ID: (your student D number)
Date: January 15,2024
import java.util. Scanner,
public class Time_Conversion
1
I/ Write your comment for the main method.
public static void main(String[] args)
{.
int inputSecond, hour, minute, second;
Scanner scan = new Scanner(System in);
System out.print("How many seconds? ");
inputSecond = scan nextIntO;
// Write your code here.
System out.println(inputSecond +" second(s) is equivalent to "+ hour +" hour(s),"+ minute + "minute(s), and "+ second +" second(s) is ");
3
 Problem #1(5 marks) Write an application that reads values representing a

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!