Write a program class the speed of sound

Assignment Help C/C++ Programming
Reference no: EM13998901

The speed of sound depends on the material the sound is passing through. Below is the approximate speed of sound (in feet per second) 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 class The Speed Of Sound that asks the user to enter "air", "water", or "steel", and the distance that a sound wave will travel in the medium. The program should then display the amount of time it will take.

You can calculate the amount of time it takes sound to travel in air with the following formula: time = distance/1,100
You can calculate the amount of time it takes sound to travel in watert with the following formula: time = distance/4,900
You can calculate the amount of time it takes sound to travel in steel with the following formula: time = distance/16,400

Prompts And Output . The program prompts for the medium with: "Enter one of the following: air, water, or steel: " and reads the medium. If the medium is not air, water or steel the program prints the message : "Sorry, you must enter air, water, or steel." an nothing else. Otherwise the program prompts for the distance with ("Enter the distance the sound wave will travel: " and reads it in and then prints "It will take x seconds." where x is the time calculated by your program .

Reference no: EM13998901

Questions Cloud

What are the pros and cons of trade restrictions : What are the pros and cons of trade restrictions? What are the pros and cons of free trade? Which is better in your opinion?
Account for the difference in wages between two industries : What may account for the difference in the wages between two industries that have been highly competitive? Identify and describe each factor and explain its effect on wages. If you make any assumptions about the scenario, state them.
Calculate annual depreciation for the five year : Calculate annual depreciation for the five-year life of the van using each of the following methods. Round all computations to the nearest dollar.
Describe how the agency implements the relevant law : As the human resources manager, it is your responsibility to keep all human resources employees informed about current employment law.
Write a program class the speed of sound : Write a program class The Speed Of Sound that asks the user to enter "air", "water", or "steel", and the distance that a sound wave will travel in the medium. The program should then display the amount of time it will take.
What is the present worth of a series : What is the present worth of a series that gives you $56 in period 1 and then gives you $1 more each time period until period 100 when the interest rate is 5%?
Explain how you find the winning strategy : This game is adopted from episode six of the Survivor Thailand television series that aired in fall 2002. Two players alternate in taking turns to remove some number of flags from a field with 31 flags. Each time it is a player’s turn, he may choose ..
Comparison of two hospitals using quality check function : Perform a comparison of two hospitals using the "Quality Check" function. Prepare a 5-6 page paper based on the following: Select two hospitals to compare in the state you have chosen (click white box next to hospital name to compare)
Factor notation the present worth of a cash flow : How would you describe in factor notation the present worth of a cash flow that gives you $10 in periods zero through 20, then in period 21 gives you $8, in period 22 gives $6, and so on, until period 24 when you recieve $2.

Reviews

Write a Review

C/C++ Programming Questions & Answers

  Create program that uses functions and reference parameters

Create program that uses functions and reference parameters, and asks user for the outside temperature.

  Write a program using vectors and iterators

Write a program using vectors and iterators that allows a user to maintain a personal list of DVD titles

  Write the code required to analyse and display the data

Calculate and store the average for each row and column. Determine and store the values for the Average Map.

  Write a webservices application

Write a webservices application that does a simple four function calculator

  Iimplement a client-server of the game

Iimplement a client-server version of the rock-paper-scissors-lizard-Spock game.

  Model-view-controller

Explain Model-View-Controller paradigm

  Design a nested program

How many levels of nesting are there in this design?

  Convert celsius temperatures to fahrenheit temperatures

Write a C++ program that converts Celsius Temperatures to Fahrenheit Temperatures.

  Evaluate and output the value in the given base

Write C program that will input two values from the user that are a Value and a Base with which you will evaluate and output the Value in the given Base.

  Design a base class shape with virtual functions

Design a base class shape with virtual functions

  Implementation of classes

Implementation of classes Chart and BarChart. Class barChart chould display a simple textual representation of the data

  Technical paper: memory management

Technical Paper: Memory Management, The intent of this paper is to provide you with an in depth knowledge of how memory is used in executing, your programs and its critical support for applications.

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd