1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
Ksenya-84 [330]
3 years ago
15

(Hours, minutes, and seconds) Write a method that returns a string in the form of hour:minute:second for a given total seconds u

sing the following header:
public static String format(long seconds)
Here is a sample run:

Enter total seconds: 342324
The hours, minutes, and seconds for total seconds 342324 is 23:05:24

Note that a zero is padded to hour, minute, and second if any of these values is a single digit.
Computers and Technology
1 answer:
elena-s [515]3 years ago
8 0

Answer:

Answered below.

Explanation:

class Convert {

public static String format(long seconds) {

Scanner sc = new Scanner(System.in);

System.out.print("Enter total seconds: ");

int secs = sc.nextInt();

int hours = secs / 3600;

int minutes = (secs % 3600) / 60;

int seconds = (secs % 3600) % 60;

String timeFormat = hours + ":" + minutes + ":" + seconds;

return timeFormat;

}

}

You might be interested in
A technology _____ begins with the birth of a new technology and ends when that technology reaches its limits and dies as it is
Aleks04 [339]
A technology cycle begins with the birth of a new technology and ends when that technology reaches its limits and dies as it is replaced by a newer, substantially better technology.
5 0
4 years ago
When using the red / yellow / green method to present status of a project, green can mean which of the following?
zepelin [54]
C - on track - good to go

8 0
4 years ago
Read 2 more answers
Entering the formula =SUM(C5:C18), in cell C19 will result in which of the following?
Greeley [361]
I am not sure what the 'following's are
but it should result the sum of all cells between and including C5 and C18.

5 0
3 years ago
In what way, if any, is a model different from a simulation?
madam [21]

Answer:

Models and Simulations are completely different in that they achieve diffenet results.

Explanation:

Modeling is the act of building a model. A simulation is the process of using a model to study the behavior and performance of an actual or theoretical system. In a simulation, models can be used to study existing or proposed characteristics of a system. ... Simulating is the act of using a model for a simulation.

6 0
3 years ago
Jose wants to be sure maintains a high credit score as he is planning yo buy a new car soon what should he do to ensure his scor
Vika [28.1K]
Make his payments on time
7 0
3 years ago
Read 2 more answers
Other questions:
  • You can encrypt individual files, but microsoft recommends encrypting at what level?
    9·1 answer
  • What type of address is the ip address 198.162.12.254/24?
    10·1 answer
  • If a person was on board a hypersonic airplane what do you think they would be able to see as they look out a window looking in
    13·2 answers
  • If you're using your keyboard, what actions are you most likely performing in Access?
    15·2 answers
  • QUESTION
    14·1 answer
  • If a small monster collector:- Has 16 small monster containment devices and intends to use all of them.
    10·1 answer
  • For LG, on the app Messages, will the delete button on the upper right corner cancel a sending message?
    12·1 answer
  • Size of a MAN can range from ​
    5·1 answer
  • Write a program that first reads in the name of an input file and then reads the input file using the file.readlines() method. T
    7·1 answer
  • The sun emits invisible _____> A) electromagnetic waves B) Waves C) Radiation D) Wavelength E) Ultraviolet Light
    8·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!