Write a program for the standard deviation

Assignment Help Computer Engineering
Reference no: EM132137097

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 rootof:

((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

 

Reference no: EM132137097

Questions Cloud

Shares of cumulative preferred stock outstanding : Dia Lucrii, Inc. has 325,000 shares of cumulative preferred stock outstanding. The stock is supposed to pay $2.18 in dividends per share each quarter.
Shares of cumulative preferred stock outstanding : Dia Lucrii, Inc. has 325,000 shares of cumulative preferred stock outstanding. The stock is supposed to pay $2.18 in dividends per share each quarter.
Create an assemblyline class : Create a ManufacturedProduct class. The ManufacturedProduct class is a simplified representation of a product that is being built on an assembly line.
Stock expected to grow after year 3 : At what constant rate is the stock expected to grow after Year 3? Round your answer to two decimal places. Do not round your intermediate calculations.
Write a program for the standard deviation : Write a C++ program. PLEASE FOLLOW INSTRUCTIONS EXACTLY. This program takes its inputs from a file that contains numbers.
Statements of the companies to make his investment decisions : Assume that your brother wants to buy shares of either Company A or B and is looking for your advice on how to use the financial
Financial health of the companies : Based on your review of the financial statements of Company A and B, suggest a key insight about the financial health of the companies.
Determine the enterprise value of company : 1) Assume that Company A wants to take-over Company B. Determine the enterprise Value of company B? Can Company A affo
Explain the positive effects of stereotypes on intercultural : They provide a shorthand way of dealing with differences and allowing us to categorize how people think about things and interact with our world.

Reviews

Write a Review

Computer Engineering Questions & Answers

  Pros and cons of each with a focus on it investments

Total Cost of Ownership (TCO) and 2) Return on Investment (ROI). Describe each of these approaches, state your preference, and analyze the pros and cons of each with a focus on IT investments

  By using different internet sources find out an article or

using various internet sources find an article or website about attack prevention. show your personal content mastery

  Write a method public static int count vowels

Write a method public static int count Vowels(String str) that returns a count of all vowels in the string str. Vowels are the letters a, e, i, o, and u.

  How would you measure the effect of the change

How would you measure the effect of the change? For example, consider the number of counselors used and the arrival pattern of students.

  Write a program to find the longest simple path from x to y

Write a program to find the longest simple path from x to y in a given weighted graph. Give a nondeterministic polynomial-time algorithm.

  Write a program that accepts input like the program

Write a program that accepts input like the program in Display 5.4 and that outputs a bar graph like the one in that program.

  Write program using array that asks user to input 10 numbers

Write a program using array that asks user to input 10 numbers, then calculates the average of those numbers and finds out the total number that is greater or equal to the average.

  What is the engineers duty to her employer

What is the engineer's duty to her employer? What is the engineer's duty to the environment and the public? Which duty is paramount?

  Implement an application that will hold the customer list

You will need to implement an application that will hold the customer list for Acme Anvil Supply. This list will be read from a file and stored in a binary tree.

  How many additional person-months will be needed

How many additional person-months will be needed? In general, if government's size estimate is k% too low, by how much must the person-month estimate change?

  Implementing c++ program that simulates a submarine

Design and implement the C++ program which simulates a submarine. If sub tries to leave area or it wanders into the shallow area, the simulation should end. Initialize array to -1. The user should be able to move the sub up, left, right and down.

  Write a program using a stack abstract datatype

Write a program using a stack abstract datatype to get the correct count for the trees in different parts of the jungle.

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd