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
adoni [48]
3 years ago
8

rite a program to perform time conversion. The user will select from the following menu: Hours to minutes Days to hours Minutes

to hours Hours to days. Each choice has a separate method which is called when the user makes the selection. Please see the output below: Hours to minutes. 2. Days to hours. 3. Minutes to hours. 4. Hours to days. Enter your choice: 2 Enter the number of days: 5 There are 120 hours in 5 days.
Computers and Technology
1 answer:
Vinvika [58]3 years ago
7 0

Answer:

import java.util.Scanner;

public class TimeConversion

{

public static void main(String[] args) {

   

    Scanner input = new Scanner(System.in);

           

       System.out.print("1. Hours to minutes\n2. Days to hours\n3. Minutes to hours\n4. Hours to days\n");

       System.out.print("Enter your choice:");

       int choice = input.nextInt();

       

       switch(choice) {

           case 1:

               System.out.print("Enter the number of hours:");

               int hour = input.nextInt();

               System.out.println("There are "+ hour*60 + " minutes in " + hour + " hours");

               break;

           case 2:

               System.out.print("Enter the number of days:");

               int day = input.nextInt();

               System.out.println("There are "+ day*24 + " hours in " + day + " days");

               break;

           case 3:

               System.out.print("Enter the number of minutes:");

               int minute = input.nextInt();

               System.out.println("There are "+ minute/60 + " hours in " + minute + " minutes");

               break;

           case 4:

               System.out.print("Enter the number of hours:");

               int h = input.nextInt();

               System.out.println("There are "+ h/24 + " days in " + h + " hours");

               break;

           default:

               System.out.println("Invalid Input!");

       }

}

}

Explanation:

- Print the menu

- Ask the user to choose one of the options

- Depending on the choice, use switch-case statement to calculate and print required conversion

- Print an error message if the user enters a number that is not in the menu

You might be interested in
Data mining must usestatistics to analyze data.<br> True<br> False
Rasek [7]

Answer: True

Explanation: In data mining, they use statistics component for the analyzing of the large amount of data and helps to deal with it. Statistics provide the techniques for the analyzing, evaluating and dealing with the data that is known as data mining.Data statistics provide the help to organize large data in a proper form and then analyze it. Thus, the statement given is true that data mining must use statistics to analyse data.

4 0
3 years ago
Identify the hardware components in your own computer. If you don't have a computer, use a friend's, or one at work or in an NVC
sergij07 [2.7K]

Solution :

A friend of mine have an old version of computer PC having the following components :

Input devices

Model name of the keyboard -- PUNTA , model number -- P-KB515

Model name of the mouse -- PUNTA, model number -- P-KB515

Output devices

Speaker : COMPAQ

Monitor : ACER,  Model Number  --- EB192Q

Storage : 500 MB capacity hard disk

RAM : 2 GB

Processor : Intel Pentium dual E1260 at the rate 1.80 GHz

It is provided with audio jacks

5 0
2 years ago
What property of semi-metals is useful in the computer industry?
artcher [175]
The answer is (a. Semi-conducting)
In the computer industry, semi-metals with a semiconducting property are useful in making of semiconductors. These metals have high resistance but lower than compare to insulators. This conductor could be crystalline or amorphous solids.
4 0
3 years ago
Which procedure is recommended when cleaning inside a computer? Clean the hard drive heads with a cotton swab. Hold the CPU fan
ddd [48]

Answer:

Hold the CPU fan so that it won't spin and blow this with compressed air.

Explanation:

While cleaning the computer system from the inner side then we have to follow some steps.

  • Firstly, shut down the system properly and remove it from the power supply.
  • Then, open the cabinet of the computer system.
  • Then, clean the internal parts of the system through simple air pressure and hold the CPU fan during that time to avoid spinning.
  • Clear the dirt layer using the can of compressed air over the cabinet fans.
8 0
3 years ago
According to the Center for 21st Century Skills, critical thinking ability includes all of the following skills, EXCEPT ______.
Readme [11.4K]

Answer:

communicate clearly

Explanation:

4 0
3 years ago
Other questions:
  • What sugar is used in a DNA molecule​
    7·2 answers
  • Header and Footer options are located in the _____ tab.
    7·1 answer
  • When we put 10+ points for when we ask a question, do we loose the points we have?
    12·1 answer
  • What operating system is an open source program
    15·1 answer
  • What are the three basic classes of application
    14·2 answers
  • How can we style the images and layouts of our pages?
    8·1 answer
  • PLS HEEELLLP ASAP, DONT JOKE
    9·2 answers
  • Classify computer based on signal
    14·1 answer
  • Complete the following sentence by choosing the best answer from the options listed below.
    11·2 answers
  • Question #1
    13·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!