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]
2 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]2 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
When working in outline mode, press __________ and click the eye icon to change only one layer back to preview mode.
Natasha2012 [34]

Answer:

Butt

Explanation:

erflies

4 0
2 years ago
Which is an example of intrinsic motivation?
kkurt [141]

Answer: allowing time to do an after-school activity once studying is done

Explanation: Motivation could be explained as any event, factors or circumstances which increases an individual's willingness, zeal or strength to do something. Motivation could also be inform of incentive or reward which one stands to gain when a certain assignment or mission is accomplished.

However, Intrinsic motivation refers to a class of motivation which are triggered naturally. When a motivation is intrinsic, there is no usually no obvious and or external source of motivation, incentive or reward attached to one's quest of doing something. In the scenario above, all other options except allowing time to do an after-school activity once studying is done have a lucid external incentive which the individual stands or aims to achieve by studying.

5 0
3 years ago
Read 2 more answers
How will you apply what you have learned in our topic today in a real life situation? Show your answers in the acronyms provided
alexira [117]
It means get in the kitchen woman that’s what cookery means
8 0
3 years ago
Computer science student jones has been assigned a project on how to set up sniffer. What just he keep in mind as part of the pr
noname [10]

In the case above, what just comes to  mind as part of the process is option d.

<h3>What is sniffer?</h3>

A sniffer is known to be a kind of a software or hardware tool that gives room for a person to be able to “sniff” or look through one's internet traffic in real time, getting  all the data flowing to and from a person's computer.

Therefore, In the case above, what just comes to  mind as part of the process is option d.

Learn more about sniffer from

brainly.com/question/14265770

#SPJ1

3 0
1 year ago
.....is used to save project in Visual basic .net from file menu
Harlamova29_29 [7]

Explanation:

I don't really understand what you're trying to get at, maybe try to abbreviate a little more?

4 0
3 years ago
Other questions:
  • Plz tell me a storage device that should be used for this and why
    11·1 answer
  • Which partitioning method must you use for a 4-tb hard drive?
    13·1 answer
  • . Why should we favor programming to interfaces over implementations?
    6·1 answer
  • 8) The higher the drag coefficient, the_____ the car will go<br> a)Siower<br> b)Faster
    9·2 answers
  • What are 2 plants that grow best in our soil type ​
    9·1 answer
  • Which of the following is NOT considered a step in the problem solving process. A Try B Discover C Prepare D Define
    12·1 answer
  • Which of the following is not a skill set required by data scientists? A. Programming expertise B. Big data expertise C. Telecom
    11·1 answer
  • How might the website owner use theses details other than to verify login details?
    6·2 answers
  • Assembly (Procedure and Conditional Processing). For the following program, what are outputs for register EAX, EBX, ECX, and EDX
    11·1 answer
  • Which of the following is a key difference between a Windows 7 restore point and one you set yourself?
    11·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!