C++ Programming: From Problem Analysis to Program Design
C++ Programming: From Problem Analysis to Program Design
8th Edition
ISBN: 9781337102087
Author: D. S. Malik
Publisher: Cengage Learning
bartleby

Videos

Textbook Question
100%
Book Icon
Chapter 6, Problem 12PE

Write a program that takes as input five numbers and outputs the mean (average) and standard deviation of the numbers. If the numbers are x 1 ,   x 2 ,   x 3 ,   x 4 , and  x 5 , then the mean is x = ( x 1 + x 2 + x 3 + x 4 + x 5 ) / 5 and the standard deviation is:

s = ( x 1 x ) 2 + ( x 2 x ) 2 + ( x 3 x ) 2 + ( x 4 x 2 ) + ( x 5 x 2 ) 5

Your program must contain at least the following functions: a function that calculates and returns the mean and a function that calculates the standard deviation.

Blurred answer
Students have asked these similar questions
A typical NMR peak after Fourier transform has a Lorentzian absorptive line shape. This line shape is represented by the function below, where x is in Hz 1 f (x) : x2 + 1 Write a program to calculate the integral of this function using Riemann sums on the range from [-10, 10] (inclusive) with dx = 0.01. In other words, estimate the following integral with a Riemann sum. 10 1 x2 + 1 -10
Write a program that reads integers between 1 and 100 and counts the occurrences of each. Assume the input ends with 0. Write a program that reads integers between 1 and 100 and counts the occurrences of each. Assume the input ends with 0.   Here is a sample run of the program: Enter integers from 1-100 (input 0 value to end inputs): 2 5 6 5 4 3 23 43 2 02 occurred 2 times3 occurred 1 time4 occurred 1 time5 occurred 2 times6 occurred 1 time23 occurred 1 time43 occurred 1 time
Write a program that calculates the equivalent resistance of a circuit. n electrical resistors with resistance values R1, R2,.., Rn are said to be connected in parallel if the same voltage is applied across each. Their equivalent resistance Reg is related to the values R1, R2, ..., Rn by: 1 1 1 1 + +...+ R R R, R. "eq Write a program that prompts the user to enter the resistance of n resistors. The user should be prompted continuously by using a while loop until a zero or negative value is entered (the program should count the number of resistors n entered by the user and store the values in an array). Use another separate loop to print the resistance values entered by the user and the equivalent resistance Reg. Test your program with R1= 1 kn, R2= 2 kn, R3= 4 kQ and R4= 8 kQ.
Knowledge Booster
Background pattern image
Computer Science
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
SEE MORE QUESTIONS
Recommended textbooks for you
Text book image
Database System Concepts
Computer Science
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:McGraw-Hill Education
Text book image
Starting Out with Python (4th Edition)
Computer Science
ISBN:9780134444321
Author:Tony Gaddis
Publisher:PEARSON
Text book image
Digital Fundamentals (11th Edition)
Computer Science
ISBN:9780132737968
Author:Thomas L. Floyd
Publisher:PEARSON
Text book image
C How to Program (8th Edition)
Computer Science
ISBN:9780133976892
Author:Paul J. Deitel, Harvey Deitel
Publisher:PEARSON
Text book image
Database Systems: Design, Implementation, & Manag...
Computer Science
ISBN:9781337627900
Author:Carlos Coronel, Steven Morris
Publisher:Cengage Learning
Text book image
Programmable Logic Controllers
Computer Science
ISBN:9780073373843
Author:Frank D. Petruzella
Publisher:McGraw-Hill Education
Java random numbers; Author: Bro code;https://www.youtube.com/watch?v=VMZLPl16P5c;License: Standard YouTube License, CC-BY