Question: Write a program that will do the following pseudo-code: Display a title, such as Working with random numbers and simple mathematical functions. Declare as many
Write a program that will do the following pseudo-code:
-
Display a title, such as Working with random numbers and simple mathematical functions.
-
Declare as many variables as needed to enhance the readability of your program.
-
Generate 3 random numbers between 1 and 100 inclusive, named: r1, r2, and r3
-
Calculate avg, the average of the 3 random numbers.
-
Calculate sum = (r1 - avg)2 + (r2 - avg)2 + (r3 - avg)2
-
Calculate stDev, the standard deviation of the 3 random numbers: it is the square root of
(sum divided by 2).
-
Calculate gMean, the geometric mean of the random numbers (the product of these
numbers to the power of 1 / 3)
-
Display the random numbers, their average, standard deviation and geometric mean with
description.
Run this program twice.
This is for a C++ assignment, and I am having trouble on what it's asking after step 1. An explanation and guide through would be great, thanks.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
