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
Who am I
kvv77 [185]
1. Patent law or copyright
2. Malware
3. Cybercrime
4. Firewall
4 0
3 years ago
Hello guys where's bios chip in this motherboard ​
dolphi86 [110]

Answer: This. is an old Asus Board and the chip is missing

Explanation: The BIOS chip goes into the Processor holder. the one with the curved metal arm to help release it (goes into the cage first you use glue made for ) installing the chip, then you place the processor on top of that big part where it resembles a slice of bread.  You lock down the four legs and that is the brain of the MB.

To update the BIOS,in the machine outside of the operating system. ON WIndows it is the command center on Mac it is different.

The CMOS Battery is next to the word ASUS .

The BIOS is code and software that you upload from the manufacturer's site like ASUS.  and in the command environment, you update the bios.

The CHIP is delicate and it ONLY GOES  on ONE WAY! BE Verry very careful installing the chip and processor better to have a pro (like me ) do it ...

Motherboards are very delicate and expensive! All parts go one way and one way only. Be glad you don't have to Sauter anything.

3 0
1 year ago
When the POST is complete,t he operating systems is loaded into?
Lina20 [59]
<span>After the POST is successfully completed the CPU searches Storage devices for special files that indicate the beginning of the OS and then loads it into memory. </span>

<span><span>The sequence in which the storage devices are searched is part of the configuration set-up stored in BIOS. 

</span><span>Once the Operating System (OS) is located, the CPU copies what’s called the 'boot record' from the OS into DRAM. 

</span><span>Control is then passed to the 'boot record' in DRAM, which then continues loading the rest of the OS. 

</span><span>This process continues until the OS load is completed. 

</span><span>When the OS load is completed the Desktop appears in the display and waits for you, the user, to tell it what you want it to do.</span></span>
4 0
3 years ago
Obtain the Truth tables to the following Boolean expressions, and prove the solution's in sagamath
nlexa [21]
The answer to your question is b☺️☺️
4 0
3 years ago
What software sent bill gates on his way to becoming one of the richest men in the world?
just olya [345]
The software that launched Bill Gates to riches is Microsoft. The software company became available for public purchase of shares in 1986. The company was however launched in 1975 by himself and the co-founder Paul Allen. The company was instrumental in the launch of the personal computer revolution. 
5 0
4 years ago
Other questions:
  • 1.What is a project methodology?
    9·1 answer
  • The term _____ refers to computers that are among the fastest of any in the world at the time of their introduction.
    6·1 answer
  • Which is a type of display monitor? HDD CPU SSD LCD
    6·1 answer
  • The numbering system we commonly use is called the decimal numbering system because it uses ________ symbols to represent all po
    5·1 answer
  • When a manager is told that it's acceptable to take credit for work that junior
    11·1 answer
  • How long does it take rblx to re open deleted acc
    8·2 answers
  • Choose two technologies that you think would help the company meet its goals. Then fill in the chart below to compare the techno
    11·2 answers
  • Android OS "AFTER" Beta.<br><br> A. Cupcake<br><br> B. Candy<br><br> C. Cookie<br><br> D. Carmel
    12·1 answer
  • Carmen has met new people online that she enjoys talking to. One of these people has asked her to meet at the park in person and
    15·1 answer
  • What steps can you take to secure your private information?.
    8·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!