Question: Styles Harmonic Mean Function Write a C++ program that repeatedly asks the user to enter pairs of numbers until at least one of the numbers

 Styles Harmonic Mean Function Write a C++ program that repeatedly asks

Styles Harmonic Mean Function Write a C++ program that repeatedly asks the user to enter pairs of numbers until at least one of the numbers in the pair is zero (0). For each pair, the program should use a function to calculate the harmonic mean of the numbers. The function should return the answer to main(), which should report the results. The harmonic mean of the numbers is the inverse of the average of the inverses and can be calculated using the following formula: Harmonic mean = 2.0 * X * Y / (X + Y) For example, the Harmonic Mean of 3 and 5 looks like this: = 2.0 + 3.0 * 5.0 / (3.0 + 5.0 ) = 30.0 / 8.0 = 3.75 To help test your program, here are a few examples of Harmonic Mean values: The Harmonic Mean of 4 and 9 is 5.53846 The Harmonic Mean of 6 and 9 is 7.2 The Harmonic Mean of 12 and 18 is 14.4 The Harmonic Mean of 3 and 7 is 4.2 The Harmonic Mean of 12 and 58 is 19.8857

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!