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
Ostrovityanka [42]
3 years ago
10

Write a program that displays a menu allowing the user to select air water, or steel. After the user has made a selection, the n

umber of feet a sound wave will travel in the selected medium should be entered. The program will then display the amount of time it will take. (Round the answer to four decimal places.)
Computers and Technology
1 answer:
luda_lava [24]3 years ago
7 0

Answer:

// Program is written in C++ Programming Language

// Comments are used for explanatory purpose

// Program starts here

#include<iostream>

using namespace std;

int main ()

{

// Declare Variable

int selection;

// Prompt user to make a selection of medium between air, water or steel.

cout<<"Make Selection"<<'\n'<<"Press 1 for Air"<<'\n'<<"Press 2 for Water"<<'\n'<<"Press 3 for Steel";

cin>>selection;

// Check for entry

if(selection == 1) {

cout<<"You selected Air"<<'\n';

cout<<"The distance travelled by sound wave in air is 1,125 feet in 1 second";

}

else if(selection == 2) {

cout<<"You selected Water"<<'\n';

cout<<"The distance travelled by sound wave in water is 4859 feet in 1 second";

}

else if(selection == 3) {

cout<<"You selected Steel"<<'\n';

cout<<"The distance travelled by sound wave in steel is 19554 feet in 1 second";

}

else

cout<<"Invalid Selection";

return 0;

}

You might be interested in
I need to create a method named "root positive". which will either print the square root of the number passed to it or if the nu
rjkz [21]

Answer:

Explanation:

The following code is written in Java. It is a method that calculates the square root of a number as requested. The method first checks with an IF statement if the parameter value is a positive number and then calculates the square root and prints it to the screen. Otherwise, it prints Number must not be negative. A test case has been provided in the main method and the output can be seen in the attached image below.

import java.util.Scanner;

class Brainly {

   public static void main(String[] args) {

       Scanner in = new Scanner(System.in);

       System.out.print("Enter a number of type double to calculate square root:");

       double num = in.nextDouble();

       rootPositive(num);

   }

   public static void rootPositive(double num) {

       if (num > 0) {

           System.out.println(Math.sqrt(num));

       } else {

           System.out.println("Number must not be negative.");

       }

   }

}

5 0
3 years ago
An application team plans to follow the 10-phase SDLC model. After the team identifies both functionality and security requireme
Valentin [98]

Answer:

The team did not adequately formalize the software's design

Explanation:

The most logical reason for this confusion is the fact that the team did not adequately formalize the the software design.

The design approach has to do with clearly defining the architectural modules of the application. The requirements in the software requirement specification document would serve as input for the next phase. The documents are prepared and they give a definition of the overall system architecture.

The team got confused because they did not go through this phase of the 10-phase SDLC model.

3 0
2 years ago
For this problem, you will write a function standard_deviation that takes a list whose elements are numbers (they may be floats
Evgesh-ka [11]

Answer:

  1. import math  
  2. def standard_deviation(aList):
  3.    sum = 0
  4.    for x in aList:
  5.        sum += x  
  6.    
  7.    mean = sum / float(len(aList))
  8.    sumDe = 0
  9.    for x in aList:
  10.        sumDe += (x - mean) * (x - mean)
  11.    
  12.    variance = sumDe / float(len(aList))
  13.    SD = math.sqrt(variance)
  14.    return SD  
  15. print(standard_deviation([3,6, 7, 9, 12, 17]))

Explanation:

The solution code is written in Python 3.

Firstly, we need to import math module (Line 1).

Next, create a function standard_deviation that takes one input parameter, which is a list (Line 3). In the function, calculate the mean for the value in the input list (Line 4-8). Next, use the mean to calculate the variance (Line 10-15). Next, use sqrt method from math module to get the square root of variance and this will result in standard deviation (Line 16). At last, return the standard deviation (Line 18).

We can test the function using a sample list (Line 20) and we shall get 4.509249752822894

If we pass an empty list, a ZeroDivisionError exception will be raised.

3 0
3 years ago
What is the shortcut key to launch the Macros dialog box?
Otrada [13]

Answer:

On excel, Ctrl + F8 is the shortcut for the Macros dialog box

Explanation:

7 0
3 years ago
A film producer is having difficulty with distribution. After major and minor theaters show no interest in the film, what would
irinina [24]

Answer:

pursue internet distribution

Explanation:

4 0
2 years ago
Other questions:
  • Write a program that checks for car mileage. if the mileage is greater than 100000, display "clunker!". if not, display "buy it!
    7·1 answer
  • What feature new to Windows Server 2012 provides the ability to find identical sets of data on a SAN based storage array and red
    14·1 answer
  • A forensic investigator at a crime lab is performing a forensic analysis of a hard drive that was brought in by state troopers.
    10·1 answer
  • 1⁰=?<br> Is equal to...........
    12·2 answers
  • My laptop volume has got really low all of a sudden. It wasn't the best to start with but now i can barely even hear it at 100%.
    10·1 answer
  • Ken is a mobile app developer. He is designing a mobile app that offers tips and guidance to people interested in learning jazz
    8·2 answers
  • Which of these can be represented visually by a flowchart?
    11·2 answers
  • Please help me with these questions. Thanks o((&gt;ω&lt; ))o
    12·1 answer
  • 1. Keisha is in her first semester of college and is taking 10 credit hours: ACA 122, CIS 110, PSY 150, and developmental math.
    11·1 answer
  • The direction of a ratchet is reversed by _______________________.
    14·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!