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
Thepotemich [5.8K]
3 years ago
9

The speed of sound depends on the material the sound is passing through. Below is the approximate speed of sound (in feet per se

cond) for air, water and steel:
air: 1,100 feet per second

water: 4,900 feet per second

steel: 16,400 feet per second


Write a program that displays a menu allowing the user to select air, water, or steel. After the user has made a selection, he or she should be asked to enter the distance a sound wave will travel in the selected medium. The program will then display the amount of time it will take.

Menu. The menu should look exactly like this:

Select a medium:
1. Air
2. Water
3. Steel

Computers and Technology
1 answer:
german3 years ago
8 0

Answer:

The Java Program for the given problem is as below. Directly copy the code and run it on your machine.

Explanation:

Refer the Screenshots attached for the output.

import java.io.BufferedReader;

import java.io.InputStreamReader;

public class TheSpeedOfSound {

public static void main(String[] s)

{

String medium;

double distance;

double time;

try{

BufferedReader choice = new BufferedReader(new InputStreamReader(System.in));

System.out.println("Enter one of the following: air, water, or steel: ");

medium = choice.readLine(); // reading input i.e. air, water or steel

//check for air water and steel

if (medium.equalsIgnoreCase("air") || medium.equalsIgnoreCase("water") || medium.equalsIgnoreCase("steel")){

System.out.println("Enter the distance the sound wave will travel: ");

distance = Double.parseDouble(choice.readLine()); // read distance value if it is air water or steel

switch (medium)

{

//if medium is air

case "air":

time = distance/1100;

System.out.print("It will take " + time + " seconds.");

break;

//if medium is water

case "water":

time = distance/4900;

System.out.print("It will take " + time + " seconds.");

break;

//if medium is steel

case "steel":

time = distance/16400;

System.out.print("It will take " + time + " seconds.");

break;

}

}

else{

System.out.print("Sorry, you must enter air, water, or steel.");  

}

}

catch(Exception e){

e.printStackTrace();

}

}

}

You might be interested in
Which line defines a valid CSS rule?
sladkih [1.3K]

Answer:

i beleive its c  

Explanation:

sorry if its wrong thats what i think it is

5 0
3 years ago
Read 2 more answers
I need some help with ideas
Troyanec [42]

Answer:

Maybe make a loud noise when there is an unacceptable speed

Explanation:

If you speed above the limit you will get a ticket to if it makes a loud noise you can be annoying and speed at the acceptable speed

5 0
3 years ago
What is the purpose of the Subtotal feature?
Svetradugi [14.3K]

Answer:

performs calculations

Explanation:

The SUBTOTAL function in Excel allows users to create groups and then perform various other Excel functions such as SUM, COUNT, AVERAGE, PRODUCT, MAX, etc. Thus, the SUBTOTAL function in Excel helps in analyzing the data provided.

5 0
2 years ago
What are the uses of ICT in health department write at least 6 uses in brief​
Alinara [238K]

Answer: See Explanation

Explanation:

The uses of ICT in health department include:

1. ICT helps in the improvement of the safety and the satisfaction of patients as new technologies are being developed to endure that patients are treated faster and their chance of survival increase.

2. ICT helps in looking for prevention measures which will be used to eradicate diseases.

3. ICT helps in the storage of medical data electronically. This will help in the easy retrieval of information.

4. ICT helps in the spread of information and also ensures distant consultation which are essential to achieving health related goals. e.g telemedicine.

5. ICT helps in the easy and fast spread of information and also facilitates cooperation and enhances teamwork among the health workers.

6. ICT brings about efficiency and effectiveness of administrative systems.

4 0
3 years ago
HOW CAN A PERSON GET BENEFITTED BY THE ICT BASEDSERVICES PROVIDED BY GOVERNMENT
BARSIC [14]

Answer:

Explanation:

It aims to transform the entire ecosystem of public services through the use of information technology.ICT holds particular promise in areas of governance and public participation.  Age can use information to reduce corruption and increase government transparency, accountability, efficiency and so finally gud night guys and take care.

plz mark as brainliest

5 0
3 years ago
Other questions:
  • What is the function of a data bus
    11·1 answer
  • Who defined the term crowdsourcing in a Wired magazine article?
    15·1 answer
  • Consider the following methods:
    10·1 answer
  • a traditional wireless network involving access points that all have wired connections is known as a ?​
    5·1 answer
  • If your organization hires a new employee, what would you do to create a user account in the Linux system and add the account to
    11·1 answer
  • What is the definition of a flowchart? *
    13·1 answer
  • Software is the brain of computer. Explain this starement
    5·1 answer
  • What is the function of ROM?
    10·1 answer
  • Write javascript code for the form that appears in the image below. you are expected to add validation to the name field, email
    10·2 answers
  • What year does futurist ray kurzweil believe ai will meet human intelligence?.
    11·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!