Anne
Dawson: CSCI101A_HW2_SP05.htm
Last
updated: Thursday 3rd February 2005, 6:20 PT, AHD
This
document is subject to change without notice.
Please
report any errors or omissions in this document:
adawson@coquitlamcollege.com
Special instructions:
For this assignment you must work alone.
Spring 2005
Homework 2
Specification: Calculation of Linear Regression
Step 1
Study
this web page:
http://phoenix.phys.clemson.edu/tutorials/excel/regression.html
Note:
you do not type in the code of your program until Step 4.
Your program should read in a
set of x,y pairs from a file, calculate the equation of the best straight line
through the data, and output the equation of the straight line to the screen.
You should use several files of test data of various size. The user of the
program should be prompted for the file name. The program should repeat at the
user’s request.
Step 2
http://www.coquitlamcollege.com/adawson/Pseudocode.htm
http://www.coquitlamcollege.com/adawson/Pseudocode.htm
// Purpose: Linear regression calculation
// Programmer: [your name]
// Course: CSCI101A
// Date:
// Test data:
Student name:
|
Category |
Points |
Description |
|
Algorithm |
10 |
An informal description of the steps that must be taken
to solve the problem. |
|
Pseudocode |
10 |
A formal description of the steps that must be taken to
solve the problem. |
|
Comments |
10 |
The program is commented appropriately. |
|
Style |
10 |
The source code should use meaningful variable
names (identifiers), appropriate data types and control structures. |
|
Modularity |
20 |
Functions should be used where it makes sense
to use them. All functions should have pre- and post-condition comments. |
|
Output |
10 |
Screen prompts and results should be
user-friendly. |
|
Correctness |
10 |
The program should output correct results. |
|
Completeness |
10 |
The program should be complete. |
|
Test |
10 |
Comments in the code explain how the code was
tested. |