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 (9th Edition)
Additional Engineering Textbook Solutions
SURVEY OF OPERATING SYSTEMS
Starting Out with C++ from Control Structures to Objects (9th Edition)
Mechanics of Materials (10th Edition)
Computer Science: An Overview (13th Edition) (What's New in Computer Science)
Management Information Systems: Managing The Digital Firm (16th Edition)
Java: An Introduction to Problem Solving and Programming (8th Edition)
- (Conversion) Blood pressure is the force of blood circulating against the inner wall of blood vessels. It’s measured by two numbers: a systolic number that measures the pressure when the heart is contracting and a diastolic number that measures the pressure when the heart is resting. Both pressures are typically measured in millimeters of mercury (mm Hg) and given assystolic/diastolic numbers, such as 122/88. The National Heart, Blood, and Lung Institute provides the following guidelines for normal and high blood pressure measurements. Complete the chart by converting the measurements to atm and psi units.arrow_forwardThe Harris-Benedict equation estimates the number of calories your body needs to maintain your weight if you do no exercise. This is called your basal metabolic rate, or BMR. The calories needed for a woman to maintain her weight is: WBMR = 655 + (4.3 × weight in pounds) + (4.7 × height in inches) − (4.7× age in years) The calories needed for a man to maintain his weight is: MBMR = 66 + (6.3 × weight in pounds) + (12.9 × height in inches) − (6.8 × age in years) A typical chocolate bar will contain around 230 calories. Write a java program that allows the user to input his or her weight in pounds, height in inches, and age in years. The program should then output the number of chocolate bars that should be consumed to maintain one’s weight for both a woman and a man of the input weight, height, and age. NOTE: This is an application of a selection statement! Input Data: Use a named constant for the number of calories in a “typical chocolate bar.” Use Scanner methods to enter the…arrow_forwardThe difference between two numbers is 15. If one number is represented by x, the other number can be expressed as whatarrow_forward
- The mitotic index is a calculated value that represents the percentage of cells in a sample that are actively dividing. It involves counting the total number of cells present including those actively dividing or those in interphase, the total number of cells that are actively dividing (not including interphase), and then calculating what percentage of the total cells are actively dividing (the percentage undergoing mitosis). The formula is: Mitotic index= # of cells in mitosis / # of cells in total x 100% Use this formula to calculate the mitotic index for the diagram seen in Question 5. Show your calculations (you can use * for multiplication and / for division if you prefer) and indicate your final answer as a percentage rounded to the nearest tenth of a percentage (1 decimal place). Note: The mitotic index seen in this simulation is much higher than you would see in a real tissue sample. The sample was simulated this way so that the counting and calculations would be easier…arrow_forwardGolf scores record the number of strokes used to get the ball in the hole. The expected number of strokes varies from hole to hole and is called par (possible values: 3, 4, or 5). Each score's name is based on the actual strokes taken compared to par: "Eagle": number of strokes is two less than par "Birdie": number of strokes is one less than par "Par": number of strokes equals par "Bogey": number of strokes is one more than par Given two integers that represent the number of strokes used and par, write a program that prints the appropriate score name. Print "Error" at the end of the output if par or score is not in the expected range. Ex: If the input is: 3 4 the output is: Par 4 in 3 strokes is Birdiearrow_forwardThe acceleration due to gravity at the surface of the moon is approximately 1/6 of the earth's. The acceleration due to gravity at the surface of moon is equal to: Group of answer choices 64 in/s2 none of the above 1.6 ft/s2 5.4 m/s2arrow_forward
- An ISBN-10 (International Standard Book Number) consists of 10 digits: The last digit, is a checksum, which is calculated from the other nine digits using the following formula: (d1 x 1 + d2 x 2 + d3 x 3 + d4 x 4 + d5 x 5 + d6 x 6 + d7 x 7 + d8 x 8 + d9 x 9) % 11) If the checksum is 10, the last digit is denoted as X, according to the ISBN convention. Write a program that prompts the user to enter the first 9 digits as a string and displays the 10-digit ISBN (including leading zeros). Your program should read the input as a string.arrow_forwardFix the codearrow_forwardThe total nuclear binding energy is the energy required to split a nucleus of an atom in its component parts: protons and neutrons, or, collectively, the nucleons. It describes how strongly nucleons are bound to each other. When a high amount of energy is needed to separate the nucleons, it means nucleus is very stable and the neutrons and protons are tightly bound to each other. The atomic number or proton number (symbol Z) is the number of protons found in the nucleus of an atom. The sum of the atomic number Z and the number of neutrons N gives the mass number A of an atom. Figure 1: Binding Energy in the Nucleus The approximate nuclear binding energy Eb in million electron volts, of an atomic nucleus with atomic number Z and mass number A is calculated using the following formula: See pictures The binding energy per nucleon (BEN) is calculated by dividing the binding energy (Eb) by the mass number (A). You are asked to write a program that requests the user for a valid atomic…arrow_forward
- All composite numbers less than 25. Natural number less than or equal to 20. Prime numbers between 1 to 35. All even prime numbers. All numbers divisible by 7 between 1 to 70.arrow_forwardThe simplest income tax calculation for a single person filing federal income taxes in the United States involves applying a standard deduction, personal exemption and marginal tax rates to the annual income of the taxpayer. For tax year 2015, the standard deduction for an individual was $6300 and the personal exemption was $4000. The 2015 tax rates vary by income bracket and are given in the table below. Tax Rate 10% 15% 25% 28% 33% 35% 39.6% which equals $6203.50. You can calculate an "effective tax rate" based on the original income as Income Range $0.01-$9,225.00 $9,225.01-$37,450.00 $37,450.01-$90,750.00 $90,750.01-$189,300.00 $189,300.01-$411,500.00 $411,500.01-$413,200.00 Over $413,200 To compute the tax liability on a given income, first the deduction and exemption amounts are subtracted, then each portion of the income is taxed at the marginal rate according to the table. For example, for an income of $51,939 (US median income in 2014) you first apply the standard $6,300…arrow_forwardA multiple-choice quiz consists of 5 questions with 4 possible choices. In how many ways can a student answer the questions if the student answers every question (i.e. they don't leave any question blank). Group of answer choices. 1024,512,2048,256arrow_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 LearningEnhanced Discovering Computers 2017 (Shelly Cashm...Computer ScienceISBN:9781305657458Author:Misty E. Vermaat, Susan L. Sebok, Steven M. Freund, Mark Frydenberg, Jennifer T. CampbellPublisher:Cengage Learning
- Programming Logic & Design ComprehensiveComputer ScienceISBN:9781337669405Author:FARRELLPublisher:CengagePrinciples of Information Systems (MindTap Course...Computer ScienceISBN:9781285867168Author:Ralph Stair, George ReynoldsPublisher:Cengage LearningEBK JAVA PROGRAMMINGComputer ScienceISBN:9781337671385Author:FARRELLPublisher:CENGAGE LEARNING - CONSIGNMENT