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
. Write a statement that throws an IllgalArgumentException with the error message Argument cannot be negative.
dybincka [34]

Answer:

public class PostAccount

{

  public void withdraw(float savings)

  {

     if (savings >=0 )

     {

        IllegalArgumentException exception

              = new IllegalArgumentException("Savings cannot be negative");

        throw exception;

     }

     balance = savings - withdraw;

  }

 }

Explanation:

IllgalArgumentException is a type of NumberFormatException  of runtime exception. Here in the program we have created an object of IllgalArgumentException class and after that we have thrown the error to show the condition if it does not satisfy the if condition.

8 0
3 years ago
"To speed up magnetic hard drive performance , ___________ is often used. "
Harrizon [31]

Answer:

disk caching

Explanation:

Hi,

Magnetic hard drives use disk caching to speed up performance. This method is quite ingenious because what it does is that in a section of memory in your pc, it keeps a copy of information that was previously accessed in the hard disk. So, next time if the same data is requested, the system can refer to cache to get quick access rather than going to the hard disk (which is slower).

3 0
3 years ago
Identify the statement below that is not true of the 2013 COSO Internal Control updated framework. a. It provides users with mor
gladu [14]

Answer:

C. It adds many new examples to clarify the framework concepts.

Explanation:

COSO is short for Committee of Sponsoring Organizations of the TreadWay Commission.The original framework released by COSO was the Internal Control-Integrated Framework, published in the year 1992. The purpose of this framework is to help in establishing effective internal control in businesses.

The updated framework was published in the year 2013. The purpose of this updated frame work includes;

  • helping businesses in establishing an effective and efficient internal control system that would help them in the implementation and documentation of issues affecting their businesses.

  • It also provides users with more precise guidelines which does not take away from the original framework, but rather builds on it.
6 0
3 years ago
You are sharing your computer screen to collaborate on a document. Which view should you use to minimize the ribbon and give you
Alinara [238K]

The view that you should use to minimize the ribbon and give your document the most screen space is Read Mode (Windows) or Focus (Mac).

<h3>What is Microsoft read mode?</h3>

Microsoft Office is one that gives a lot of different views for documents, and one of which is read mode.

Note that the Read Mode was set to help remove distractions while reading and working on document.

Therefore, The view that you should use to minimize the ribbon and give your document the most screen space is Read Mode (Windows) or Focus (Mac).

See options below

Read Mode (Windows) or Focus (Mac)

Draft view

Web Layout view

Outline view

Learn more about computer from

brainly.com/question/24540334

#SPJ1

5 0
2 years ago
Some systems provide a small amount of dedicated memory built into the CPU that maintains a record of previous choices for each
rewona [7]

Answer:

b) branch history table

Explanation:

Branch prediction in computer architecture which works by predicting or guessing  which way an operation (conditional operation: like an if-else-operation)  will go before it occurs. This operation is performed by a digital circuit known as branch predictor. Branch history table contains the address of the branch instruction. In branch history table, when there is a branch instruction, a bit is store to indicate if the branch was recently taken.

3 0
4 years ago
Read 2 more answers
Other questions:
  • In excel, a cell is referred to by its cell __________, which is the coordinates of the intersection of a column and a row. answ
    14·1 answer
  • A company is updating their office routers that handle all incoming and outgoing networking traffic. They would like the PCs to
    10·1 answer
  • Suppose we are working with an error-correcting code that will allow all single-bit errors to be corrected for memory words of l
    5·1 answer
  • Technician A says that oil for the rod bearings comes from splash off the crankshaft. Technician B says that lubrication to the
    14·1 answer
  • Your program will search for prime numbers. You will first ask the user for the range of values to search, and use for loops to
    6·1 answer
  • What is ABC computer?​
    14·1 answer
  • What is the BCC feature used for?
    12·2 answers
  • Who else is on spring break till april 12th?
    15·2 answers
  • Sound technology has been influenced the most by the ___.
    5·2 answers
  • What made the digital distribution of both data and visualization more accessible to a broader audience?
    7·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!