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
Which is not a proper statement?
kodGreya [7K]

Answer:

leftisBlocked()

Explanation:

4 0
3 years ago
Read 2 more answers
COULD U ANSWER THIS ???
vladimir1956 [14]

Answer:

B.lightning striking a tree

Explanation:

The crowd dispersing in all directions is not a closed-loop by any means, and students jogging around an oval track as well is not a closed-loop, and also not a cross country run from one point to another. However, the lightning striking a tree is a closed loop that best models a circuit. And as lightning strikes the tree, like a closed circuit, tree catches the fire, or in circuitry words, the current is generated, and tree catches the fire due to it, just like bulb starts glowing.

3 0
3 years ago
R15. Suppose there are three routers between a source host and a destination host. Ignoring fragmentation, an IP datagram sent f
maria [59]

Answer:

The answers are: an IP datagram, and 3 forwading tables.

Explanation:

An IP datagram sent from a source host to a destination host will travel through 8 interfaces. 3 forwarding tables will be indexed to move the datagram from source to destination.

8 0
3 years ago
Write code that inserts useritems into the output string stream itemsoss until the user enters "exit". each item should be follo
Yuliya22 [10]
If user output is ''red purble yellow exit'': red purple yellow  import java.util.Scanner;  import java. io.PrintWriter;  import java. io.StringWriter;    public class StringStreamOutput {   public static void main (String [] args) {   Scanner snr = new Scanner(Scanner.in);   Stringuseritem = '''';    StringWriter itemcharStream = new StringWriter();  PrinterWriter itemsOSS = new PrintWriter(itemcharStream);    System.out.printIn(''Enter items (type Exit to open):'');  useritem = scnr.next();    while (!userItems.Equals(''Exit'')) {  /*Your solution goes here*/     UserItem = scnr.nxt();    }     useritem = itemCharStream.toString()   System.out.printin(useritem);     return;     }    }
5 0
3 years ago
What is resource management in Wireless Communication? Explain its advantages
lubasha [3.4K]

Answer:

Wireless resources management is communication to address they faster response time.

Explanation:

Wireless communication that provide bandwidth, and transmission reliable, towards development.

This communication is discovered to the date and have consumed physical layer  of available wireless resources.

Wireless communication management all this critical topic  and the management techniques, and limited device battery power.

Communication as the address channel loss, and multi path .

Communication are the latest resources allocation and new or next generation and technologies.

Wireless communication theoretical concepts in a manner, and the necessary mathematical tools and fundamental tools.

Wireless communication device industries up to date of the topic,readers are benefit from a basic.

8 0
3 years ago
Other questions:
  • Marie uses a browser to visit a blog. What is the unique identifier of the blog?
    13·2 answers
  • Write a program that reads raw data from a file that contains an inventory of items. The items should be sorted by name, and the
    12·1 answer
  • Write a c++ program to calculate the approximate value of pi using this series. The program takes an input n that determines the
    13·1 answer
  • Write a Java class called BankAccount (Parts of the code is given below), which has two private fields: name (String) and balanc
    9·1 answer
  • Which types of files can be used to define Kubernetes manifest files? yaml, json, yaml and text files
    5·1 answer
  • What section in an ethernet frame will you find a Virtual Local Area Network (VLAN) header?
    6·1 answer
  • A __________ note is a private note that you leave for yourself or for other people who might use the presentation file
    9·1 answer
  • How do I type over Images (photo posted ​
    12·2 answers
  • 1 pts Question 5 Which of the following calculations would evaluate to 12? (36) + 2/2, 3* ((6+2)/2), 3* 6+2/2, (306+ 2)/2​
    14·1 answer
  • Rewrite the Espresso Counter program to Swap or interchange any two rows of the output. Copy and paste just the interchanged par
    14·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!