CS 210 –
Fundamentals of Programming I
Spring 2007 – Programming
Assignment 5
20 points
Out: February 20/21
Due:
February 27/28 (same day as the practical exam)
(6 points) Write an analysis and design for the function (only) described in Programming Project #4 on page 437 of the textbook that computes the standard deviation of a list of numbers. Use the format shown in class and in the on-line handout An Analysis and Design Style Guideline. Write this part as a comment block in the implementation source file as the function header as shown in the on-line handout A C++ Programming. Style Guideline for CS 210.
Note that the computation of standard deviation requires computing the average of the list of numbers. You should assume you have the ComputeAverage function written for the in-class exercise of February 20/21 and just use it.
(14 points) Implement an entire program using the function described in Programming Project #4 on page 437 of the textbook. You should copy and use the ReadNumbers and ComputeAverage functions from the in-class exercise of February 20/21. The main program should read in a list of numbers (using the ReadNumbers function), compute (using the ComputeAverage function) and display the average of the numbers read in, and compute (using the function described above) and display the standard deviation of the the numbers read in. The output might look something like:
This program computes the average and standard deviation of a list of numbers. Please enter a value (negative to quit): 97.2 Please enter a value (negative to quit): 72.5 Please enter a value (negative to quit): 83.7 Please enter a value (negative to quit): -1 The average of these numbers is: 84.4667 The standard deviation is: 10.0983
Follow the guidelines in the on-line handout A C++ Programming. Style Guideline for CS 210. As stated in the syllabus, part of the grade on a programming assignment depends on how well you adhere to the guidelines. The grader will look at your code listing and grade it according to the guidelines.
Electronically submit your source file (the .cpp file) by emailing it as an attachment to cs210@csserver.evansville.edu by 5pm on the due date. (Make sure you send it to csserver.evansville.edu. If you send to just evansville.edu, it will not be delivered.)
Please note: If you write this program using a system other than Visual Studio, please make sure that your program will compile and run under Visual Studio before you turn it in. Also check that the code is formatted correctly under the Visual Studio editor.
02/19/07