Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

STDDEV.CPP Write a C++ program. PLEASE FOLLOW INSTRUCTIONS EXACTLY. This program takes its inputs from a file that contains numbers. The program reads them in

STDDEV.CPP

Write a C++ program. PLEASE FOLLOW INSTRUCTIONS EXACTLY. This program takes its inputs from a file that contains numbers. The program reads them in as type double. The program outputs to the screen the standard deviation of the numbers in the file. The file contains nothing but numbers of type double separated by blanks and/or line breaks. The standard deviation of a list of numbers x1, x2, x3, and so forth is defined as the square root of:

((x1 a)2 + (x2 a)2 + (x3 a)2 + ) / (n - 1)

Where the number a is the average of the numbers x1, x2, x3, and so forth and the number n is the count of how many numbers there are.

Your program should take file name as input from the user. The answers should be given with 3 decimal points. Additionally, your program should define at least one function. If your program does NOT have at least one function, you will not get credit for this part of the assignment, even if your program passes submit.cs grading.

A session should look exactly like the following example (including whitespace and formatting - note that there is no whitespace at the end of each of these lines and each printed line has a newline at the end), with all manners of different numbers for inputs and the output:

Enter filename: nums.txt The standard deviation is 1.581 

The accompanying input file in this example, could look like this (note the separation by one or more spaces):

6 7 8 9 10 

or like this (note the separation by either spaces or newline characters):

6 7 8 9 10 

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Select Healthcare Classification Systems And Databases

Authors: Katherine S. Rowell, Ann Cutrell

1st Edition

0615909760, 978-0615909769

More Books

Students also viewed these Databases questions