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]
3 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]3 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
You are embedding a video in your Webpage. What three formats should you specify in the source
Bogdan [553]

Answer:

d

Explanation:

3 0
3 years ago
Can someone help my friend play over-watch she new do it. I can't help her on Friday (p.s she play on Xbox she will get it on Fr
ss7ja [257]

There should be a place on the Xbox where you can download games. Go there and type in overwatch.

Hope this helped!

5 0
3 years ago
Salesforce organizes your data into: A. Objects and records, like tabs and rows on a spreadsheet. B. Objects and fields, like co
pshichka [43]

Salesforce organizes your data into option A. Objects and records, like tabs and rows on a spreadsheet.

<h3>How does Salesforce organize data?</h3>

Salesforce is known to be a tool that helps one to put together their your into objects and records and it is said to have standard objects that has been set up and ready for use.

Hence, Salesforce organizes your data into option A. Objects and records, like tabs and rows on a spreadsheet.

Learn more about Salesforce from

brainly.com/question/7452075

#SPJ1

7 0
2 years ago
This diagram shows some peripheral devices for a computer: which of the following is true
CaHeK987 [17]

Where is the diagram and answers?

4 0
3 years ago
What does an arrow next to a menu item indicate?
katrin2010 [14]
Can you provide a screenshot maybe?
There are many menu items.

4 0
3 years ago
Other questions:
  • You have created a number of different documents using several applications including word, excel, and powerpoint. these files a
    10·1 answer
  • Every chart has a corresponding ____ that contains the numerical data displayed by the chart.
    6·1 answer
  • Unless you explicitly initialize global variables, they are automatically initialized to
    5·1 answer
  • At a minimum, your vehicle insurance policy must provide coverage of
    10·1 answer
  • ___________ is related to mass, but also includes the gravitational pull of the Earth.
    14·1 answer
  • Which statement about digital certificates is​ FALSE? A. The CA verifies a digital certificate​ user's identity online. B. Digit
    7·1 answer
  • Create a public class Dog that stores a single double age set by the constructor. (Reject negative ages using assert.) Dog shoul
    13·1 answer
  • Select the correct answer from each drop-down menu.
    9·2 answers
  • What is a valid response when identity theft occurs
    10·1 answer
  • Who knows my cousin better?
    14·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!