Write a program to calculate the geometric mean of numbers entered by a user. The program should prompt the user to enter numbers and continue to accept the numbers until the user enters 999.
Note: Do not include 999 when calculating the average.
The geometric mean of a set of numbers (x1, x2, ... xn) is given by:
(X1 * X2 ...Xn)^ 1/n
For example, the geometric mean of 3, 5, 7 and 9:
(3*5*7*9)^ 1/4 = 5.5444
The flow of the program should be as follows:
- Prompt the user to enter a number
- User enters a number
- Process the number
- Program continues to prompt user to enter numbers (repeat steps 1-3) until user enters 999
- Program displays the message 'The geometric mean is ' and then prints the mean of all the entered numbers (excluding 999) to the screen