Concept explainers
The Speed of Sound in Gases
When traveling through a gas, the speed of sound depends primarily on the density of the medium. The less dense the medium, the faster the speed will be. The following table shows the approximate speed of sound at O degrees Celsius, measured in meters per second, when traveling through carbon dioxide, air, helium, and hydrogen.
Medium | Speed (meters per sec) |
Carbon dioxide | 258.0 |
Air | 331.5 |
Helium | 972.0 |
Hydrogen | 1270.0 |
Write a
Input Validation: If the use enters an invalid menu choice the program should display an error message instead of prompting for the number of seconds.
Want to see the full answer?
Check out a sample textbook solutionChapter 4 Solutions
Starting Out with C++: Early Objects
Additional Engineering Textbook Solutions
Problem Solving with C++ (10th Edition)
Web Development and Design Foundations with HTML5 (8th Edition)
Starting Out with C++ from Control Structures to Objects (8th Edition)
Starting Out with Programming Logic and Design (4th Edition)
Starting out with Visual C# (4th Edition)
- # given a radius, find the area of a circle # use value of pi as 3.1415 def get_area_circle(r): """ what it takes radius of a circle (any positive real number) what it does: computes the area of a circle given a radius, find the area of a circle area = pi*r2 (pi times r squared) what it returns area of a circle. Any positive real number (float) """ # your code goes in herearrow_forwardBaby btc program - python Budget: $75,000 Make a string based bitcoin menu which shows the price of a bitcoin (pseudo random price), able to buy bitcoin with $75,000 budget (say "buy 0.5" meaning buy half of a bitcoin or "buy 3000" meaning buy $3000 worth of bitcoin), able to sell their bitcoin currently owned (using same format), can print their balance (show their current USD, the number of bitcoins they have in their wallet, and USD value of the bitcoins they have), and able to print their buy/sell transaction history.arrow_forwardBody Mass Index is a simple calculation using a person's height and weight. The formula is BMI = kg/m2 where kg is a person's weight in kilograms and m2 is their height in meters squared. Calculate a persons Body Mass index using their weight in pounds. This means you must first convert pounds to kilograms (kg) then apply the formula above. In converting pounds to kg, 1 pound = 0.453592 kg. So to convert pounds to kg, either multiply the pound value by 0.45359237 or divide by 2.2046226218. Then you must convert their height in inches to meters. The length in meters is equal to the inches multiplied by 0.0254. Write a program that accepts a users height as an integer in inches and their weight in pounds. Convert those inputs to their metric equivalents outlined above and determine their body mass index. Display what the conversions from and to their metric equivalents are. Display the body mass index and the category it belongs to.arrow_forward
- Question Sum implify the following expression by using the prope (x^(3))^(6)(x^(6))^(3) Full explain this question and text typing work only We should answer our question within 2 hours takes more time then we will reduce Rating Dont ignore this line.arrow_forwardWelcome to the era of Aladdin and the great magic lamp. This is 1st of January and Aladdin will be in jail for one year. He was recently caught for helping forty thieves. Now he has nothing to do. But he knows that Jasmine is waiting for him. At some point he got an idea to give Jasmine a magical program that can find intervals of months from a year. This allows her to easily determine how long it will take for Aladdin to get out. Then Aladdin rubs the magic lamp and The Genie appears. Then he asked The Genie to make such a magical program. Unfortunately the Genie doesn't know programming and he wants your help to create that magical program. Genie will give you N as the day of the year and you have to print in which month that day is. Input Format Input will contain one line with a single integer N, day of the year. Constraints 1 <= N <= 365 Output Format Print a single line containing the name of month. Be careful about the newline ('\n') at the end. Sample Input 0 1 Sample…arrow_forwardTrue or False? The expression ! (x > 0) is true only if x is a negative number.arrow_forward
- Given the statements p, q, r, s, t and u. p: The tour goes to Italy. q: The tour goes to Spain. r: We go to Venice. s: We go to Florence. Represent the following statement in symbols1. "The tour goes to Italy and did not go to Spain." 2. " If we go to Venice, then we can’t go to Florence." 3. "We go to Venice or We go to Florence." 4. "If the tour goes to Italy, then we go to Venice."arrow_forwardWhat is the range of values that x can hold after this statement is executed? double x = Math.random() * 10 + 100;arrow_forwardThe number of permutations of a set of n items taken r at a time is given by the following formulan!/r!(n−r)!: where n! is the factorial of n, r! is the factorial of r, and (n-r)! is the factorial of the result of n-r. The factorial of a number n can be solved using the following formula: n !=e−n nn √ 2 πn. If there are 18 people in your class and you want to divide the class into programming teams of 3 members, you can compute the number of different teams that can be arranged using this formula (n!/r!(n−r)!). When writing a C++ program that determines the number of potential team arrangements. You will need to use the double type for this computation.arrow_forward
- Let p = "Paris is called the City of Lights" and let q = "The Eiffel Tower is locatedin Paris". Write the English statements corresponding to each of the following:(i) ∼p V q(ii) p → q(iii) p V q(iv) ∼p ʌ∼q(v) ∼(p V q).arrow_forwardSuppose you want to deposit a certain amount of money into a savings account, and thenleave it alone to draw interest for the next 10 years. At the end of 10 years, you would like tohave $10,000 in the account. How much do you need to deposit today to make that happen?You can use the following formula, which is known as the present value formula, to find out:The terms in the formula are as follows: [5 marks]• P is the present value, or the amount that you need to deposit today.• F is the future value that you want in the account. (In this case, F is $10,000.)• r is the annual interest rate.• n is the number of years that you plan to let the money sit in the account.Write a method named presentValue that performs this calculation. The method should accept the future value, annual interest rate, and number of years asarguments. It should return the present value, which is the amount that you need to deposit today.Demonstrate the method in a program that lets the user experiment with…arrow_forwardNEED HELP ASAP PLEASE! THANK YOU! Consider a game with three dice, namely, A, B and C. Each die, when rolled, generates a number between 1 and 6 (inclusive) independently and uniformly at random. In each play, the three dice are rolled, then a monetary return is computed according to the values for dice A, B and C, using the following algorithm. ThreeDice(A, B, C) { money = -9; if (A == B and B == C) { money = money + 81; } else if (A == B or B == C or C == A) { money = money + 21; } return money; } Analyze this game by answering the following questions: (a) What is the largest possible return value of ThreeDice? (b) What is the probability of ThreeDice returning the largest possible value? Choose one from below. A. 1/18 B. 1/3 C. 1/216 D. 1/2 E. 1/6 F. none of these is correct G. 1/36 H. 1/12 (c) What is the smallest possible return value of ThreeDice? (d) What is the probability of ThreeDice returning the smallest possible value? Choose one from below. A. 5/54 B. 1/18 C. 5/9 D. 4/9…arrow_forward
- C++ for Engineers and ScientistsComputer ScienceISBN:9781133187844Author:Bronson, Gary J.Publisher:Course Technology PtrC++ Programming: From Problem Analysis to Program...Computer ScienceISBN:9781337102087Author:D. S. MalikPublisher:Cengage LearningEBK JAVA PROGRAMMINGComputer ScienceISBN:9781337671385Author:FARRELLPublisher:CENGAGE LEARNING - CONSIGNMENT
- Programming with Microsoft Visual Basic 2017Computer ScienceISBN:9781337102124Author:Diane ZakPublisher:Cengage Learning