Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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
image text in transcribed

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Programming With Visual Basic .NET

Authors: Carsten Thomsen

2nd Edition

1590590325, 978-1590590324

More Books

Students also viewed these Databases questions

Question

Explain the nature of human resource management.

Answered: 1 week ago

Question

Write a note on Quality circles.

Answered: 1 week ago

Question

Describe how to measure the quality of work life.

Answered: 1 week ago

Question

2. Provide recommendations for effective on-the-job training.

Answered: 1 week ago