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
The Institute of Electrical and Electronics Engineers (IEEE) is an organization that researches and institutes electrical standa
Evgesh-ka [11]

Answer:

True

Explanation:

The Institute of Electrical and Electronics Engineers (IEEE) is an organization that researches and institutes electrical standards for communication and other technologies. Known officially as IEEE 802.11n (or wireless-N) is the newest standard for wireless networking. Compared with earlier standards like 802.11b, wireless-N offers faster speeds, more flexibility, and greater range.

6 0
3 years ago
Read 2 more answers
Adam has decided to add a table in a Word doc to organize the information better. Where will he find this option? Insert tab, Il
RUDIKE [14]
He will have to navigate to the Insert Tab and then Click on Table option.
6 0
3 years ago
Read 2 more answers
Accepted identifier for a variable in PHP except:
olganol [36]

Answer:

b. & Puihaha

Explanation:

PHP variables are supposed to start with a $ sign.

Other rules followed by PHP variables are:

Starting character in variable name (after $) must be letter or _.

Other characters in variable names can be letters,numbers or _.

a. $_Puihaha

c. $Pui_haha

d. $Puihaha

satisfy these rules.

Whereas , b. & Puihaha does not satisfy as it starts with '&'. Moreover it also contains an invalid space character in the variable.

3 0
3 years ago
Which of the following is not a concern that has come out of the widespread adoption of the Internet?
slamgirl [31]

Answer:

The correct option is;

Selecting the correct browser to use for the sites you want to visit

Explanation:

Censorship of information is the subduing of information based on the consideration of such information being harmful or inconvenient

Increased anonymity

Making an individual anonymous which is one of the capabilities of the internet, is seen as encouraging unethical behavior and promoting discussions which are deemed uncivil in a commonly shared space online.

Unauthorized sharing of copyrighted information

The sharing and distribution of copyrighted material is against the law but it is a common occurrence and in various formats online

Out of the given options, selecting the correct browser to use for the sites you want to visit is the one that is not a concern.

5 0
3 years ago
Computers heat resistant materials breathing systems for fire fighters food-growing technologies improvements in all of the item
Scorpion4ik [409]
<span>Computers heat resistant materials breathing systems for fire fighters food-growing technologies improvements in all of the items in this list were first made possible by :  a.space exploration.</span>
4 0
3 years ago
Other questions:
  • What computer would be good for editing and streaming for less than 600$?
    7·1 answer
  • This is A C++ PROGRAM BTW!! Define a class named Money that stores a monetary amount. The class should have two private integer
    6·1 answer
  • Create a subclass of Person called Lecturer that has 2 variables of its own: employeeNumber and salary. As in the above scenario
    12·1 answer
  • Can anyone give me $2 (Reddem code/Promo Code)​
    15·2 answers
  • What is the acronym DOS in full
    15·1 answer
  • The process of identifying and removing logical errors and runtime errors is called ..............
    5·2 answers
  • windows 93 it is a website THE QUESTION IS WHAT IS THE FIRST THING THAT POPS UP WHEN YOU OPEN THE WEBSITE?
    8·1 answer
  • To qualify for a particular scholarship, a student must have an overall grade point average of 3.0 or above and must have a scie
    8·2 answers
  • Do you need a separate password for each slack channel
    13·1 answer
  • How do you believe cryptocurrency work shape the next 10 years
    6·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!