| 36 | Computing Statistics |
Statistics is important in our field. When measuring response times or rendering times, it’s helpful to collect data so you can easily spot abnormalities. For example, the standard deviation helps you determine which values are outliers and which values are within normal ranges.
Write a program that prompts for response times from a website in milliseconds. It should keep asking for values until the user enters “done.”
The program should print the average time (mean), the minimum time, the maximum time, and the standard deviation.
To compute the average (mean)
-
Compute the sum of all values.
-
Divide the sum by the number of values.
To compute the standard deviation
-
Calculate the difference from the mean for each number and ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access