Prompt the user and let them enter three integers. Store them in three variables. Print the numbers in sorted order, from smallest to largest.
Sample run: (user input underlined)
Input integer 1 : 34 Input integer 2 : 200 Input integer 3 : -14 Sorted : -14 <= 34 <= 200
This is based on Programming Challenge 18 in chapter 4 of your textbook. This table shows the approximate speed of sound in air, water, and steel.
| Medium | Speed |
|---|---|
| Air | 1,100 feet per second |
| Water | 4,900 feet per second |
| Steel | 16,400 feet per second |
Write a program that does the following:
Welcome to Sound Wave Calculator
Select the medium the sound wave will travel through.
A Air
W Water
S Steel
> A
How far will the sound wave travel (in feet)? 3500
The sound wave will travel 3.1818 seconds
Goodbye
Welcome to Sound Wave Calculator
Select the medium the sound wave will travel through.
A Air
W Water
S Steel
> w
How far will the sound wave travel (in feet)? 3500
The sound wave will travel 0.7143 seconds
Goodbye
Welcome to Sound Wave Calculator
Select the medium the sound wave will travel through.
A Air
W Water
S Steel
> s
How far will the sound wave travel (in feet)? 98765
The sound wave will travel 6.0223 seconds
Goodbye
Welcome to Sound Wave Calculator
Select the medium the sound wave will travel through.
A Air
W Water
S Steel
> z
Illegal entry. Aborting program.
Goodbye
Welcome to Sound Wave Calculator
Select the medium the sound wave will travel through.
A Air
W Water
S Steel
> S
How far will the sound wave travel (in feet)? -10
Distance cannot be negative. Aborting program.
Goodbye
sort.cpp wave.cpp