vendredi 2 décembre 2016

Urgent - C++ Create a program that calculates the average of the voltage using the formula

Requirements

Create a modular(functions) program with the brief algorithm as below:

1) Prompt the user to request the number (n) of voltage inputs. 2) Create the array of size n. 3) Call the function to calculates and return the average of the n voltages entered. 4) Call the function to calculate and return the standard deviation for the n voltages entered. 5) Call the functions to check and return the highest and lowest values that user entered. 6) Displays the result summary which includes, average, standard dev., highest and lowest values entered.

The formula for standard deviation is given as Formula [IMG]http://ift.tt/2g3yjpf]

For this program, you must create FOUR functions. The first function to calculate average, the second function to calculate standard deviation, the third function to identify the highest value and the last function to identify the lowest value based on the array and array’s size passed as the function parameters.

The functions’ prototype must follow the format as given below: // functions’ prototype //the two parameters represent an array, and array size double calcAvg(double [],int); double calcStdDev(double [],int); double getHighest(double [],int); double getLowest(double [],int); eg. Assume values[] is the array name and user has choose to enter n voltage, i. calculate average by invoking the function with statement: double avg = calcAvg(values, n); ii. calculate standard deviation by invoking the function with statement: double sDev = calcStdDev(values, n); iii. identify the highest value by invoking the function with statement: double high = highest(values, n); iv. calculate standard deviation by invoking the function with statement: double low = lowest(values, n);

Aucun commentaire:

Enregistrer un commentaire