<\/span><\/h2>\n\n\n\nThere are five lines of input (shown below):<\/p>\n\n\n\n
100\n500\n80\n.95\n1.96<\/code><\/pre>\n\n\n\nThe first line contains the sample size. The second and third lines contain the respective mean (u<\/em><\/strong>) and standard deviation (o<\/em><\/strong>). The fourth line contains the distribution percentage we want to cover (as a decimal), and the fifth line contains the value of z<\/em><\/strong>.<\/p>\n\n\n\nIf you do not wish to read this information from stdin, you can hard-code it into your program.<\/p>\n\n\n\n
<\/span>Output Format<\/strong><\/span><\/h2>\n\n\n\nPrint the following two lines of output, rounded to a scale of 2<\/strong> decimal places (i.e., 1.23<\/strong> format):<\/p>\n\n\n\n- On the first line, print the value of A<\/em><\/strong>.<\/li>
- On the second line, print the value of B<\/em><\/strong>.<\/li><\/ol>\n\n\n\n
<\/span>Solution – The Central Limit Theorem III<\/strong><\/span><\/h2>\n\n\n\n<\/span>C++<\/strong><\/span><\/h3>\n\n\n\n#include <cmath>\n#include <cstdio>\n#include <vector>\n#include <iostream>\n#include <algorithm>\nusing namespace std;\n\n\ndouble normal_dist(double m, double sd, double x)\n{ \n double p = 0.5*(1 + erf((x-m)\/(sd*sqrt(2.0))));\n return p ; \n}\n\nint main() {\n \/* Enter your code here. Read input from STDIN. Print output to STDOUT *\/ \n \n double mean = 500;\n double std = 80;\n int n = 100;\n double zScore = 1.96;\n \n double marginOfError = zScore * std\/sqrt(n);\n \n printf(\"%0.2f\\n%0.2f\", mean - marginOfError, mean + marginOfError);\n \n return 0;\n}<\/pre>\n\n\n\n