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
Alenkasestr [34]
2 years ago
13

Write a java program that prompts the user to input the elapsed time for an event in hours, minutes, and seconds. The program th

en outputs the elapsed time in seconds.
Computers and Technology
1 answer:
Arisa [49]2 years ago
6 0

Answer:

import java.util.*;

class seconds

{

public static void main (String[] args)

{

    Scanner takeinput=new Scanner(System.in);//creating a scanner object for taking input.

    int hour,min,sec; //declaring 3 variables for hour , minutes and seconds.

    System.out.println("enter hours");

    hour=takeinput.nextInt();//taking input of hours..

    System.out.println("enter minutes");

    min=takeinput.nextInt();//taking input of minutes..

    System.out.println("enter seconds");

    sec=takeinput.nextInt();//taking input of seconds..

    int tot_time_sec=(hour*60*60)+(min*60)+sec; //calculating time in seconds in variable tot_time_sec.

    System.out.println("Total time in seconds is "+tot_time_sec);//pritning total time in seconds..

}

}

For input:

7

20

45

Output is:-

Total time in seconds is 26445..

Explanation:

Above is the code for finding the time in seconds.I have taken three integer variables hour,min and sec for taking input of hours ,minutes and seconds. After taking input i have taken an integer variable tot_time_sec to store the calculated time in seconds and after that printing tot_time_sec.

You might be interested in
Port explorers ​are tools used by both attackers and defenders to identify (or fingerprint) the computers that are active on a
Evgesh-ka [11]

Answer:

b) False.

Explanation:

Port explorers ​are tools used by both attackers and defenders to identify (or fingerprint) the computers that are active on a network, as well as the ports and services active on those computers, the functions and roles the machines are fulfilling, anAn IDPS can be configured to dial a phone number and produce an alphanumeric page or other type of signal or message., is a FALSE statement.

5 0
3 years ago
Which best describe a resource each student could use to find information
marta [7]

Online library resources

Explanation

Students can utilize online library resources from various campus available for online educational uses.In the library, information on current research in the various displines can be obtained through a search on the book, journal or document.In addition to that, goggle offers academic journals and academic documents prepared by scholars for other academicians to read and get information.

8 0
3 years ago
Read 2 more answers
A(n) is the tool that will help you the most when developing the content you will use in your presentation.
ikadub [295]

Answer:

Outline

Hope it helps :)

Explanation:

7 0
2 years ago
Where in the Formula tab on the ribbon would you find the Use in Formula function?
Leviafan [203]

Answer:

In Function library you would find the use in Formula function

5 0
3 years ago
Read 2 more answers
Please help! Game design!
kvasek [131]

Answer:

player vs anonymous players

4 0
3 years ago
Other questions:
  • What allows people to create their own radio shows over the internet?
    14·1 answer
  • What is the correct process for inserting a blank worksheet in Google sheets
    12·1 answer
  • In the single-site processing, single-site data (SPSD) scenario, all processing must be done on the end user's side of the syste
    10·2 answers
  • I wrote a program to calculate how many unique students I have taught over the years. It will read in a file formatted with firs
    5·1 answer
  • Which of these is an example of collective voice?
    8·2 answers
  • Write a sed command that will display all lines of the birthday file that do not contain the string March. What was the sed comm
    13·1 answer
  • How do I create a powershell script to make a Windows user account that is a non-admin user
    7·1 answer
  • What are the steps to view two different versions of the same document at once?
    11·1 answer
  • The code to perform a binary search is below. Match the variable name with what it holds.
    12·1 answer
  • Radio spectrum is the part of the complete range of electromagnetic waves that is used for radio communication from
    14·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!