Anne
Dawson: CSCI101A_HW2_FA04.htm
Last
updated: Thursday 30th September 2004, 16:42 PT
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.
For due date, see schedule.
Fall 2004
Homework
2
Specification:
#7, page 301, 4th Ed
#7, page 293, 3rd Ed
#7, page 286, 2nd Ed
Step 1
Study the text book problem.
Step 2
Design an algorithm (the steps to solve the problem).
The following web page will help you design your algorithm and
pseudocode:
http://www.coquitlamcollege.com/adawson/Pseudocode.htm
Write your algorithm in comments in your code.
Step 3
Development the pseudocode from your algorithm.
The following web page will help you design your algorithm and
pseudocode:
http://www.coquitlamcollege.com/adawson/Pseudocode.htm
Write the pseudocode in comments in your code.
Step 4
Using your pseudocode as a guide, implement your program in the
C++ language. Use either the Borland version 5.02 or Dev-C++ IDE to edit and
run your program:
http://www.coquitlamcollege.com/adawson/Borland5.htm
http://www.bloodshed.net/devcpp.html
Your program should start with a comment block that contains the
following information:
//
File: hw2.cpp
//
Purpose:
Merging files
//
#7, page 301, 4th Ed
//
Programmer: [your name]
//
Course:
CSCI101A
//
Date:
// Test
data:
Please note: any text in a C++ program that starts with the //
symbols are known as comments. Comments are ignored when the program runs, but
are useful when we read a program, because they supply information about
the program. They are always used
at the top of a program to supply information about the purpose of a program,
its file name, the programmer etc, as shown above. They are also used in the
body of a program to explain parts of the program which may be hard to
understand. Example programs in this course will demonstrate the correct use of
comments. You are expected to supply the above set of comments (updated
appropriately) for all of your lab and homework programming assignments.
Step 5
Test your program by running supplying
your own test data. You should test your program with at least 3 sets of test data.
Show your test data and results in comments at the top of your program.
Program
points will be based on the following marking scheme:
Marking
Scheme
Student
Name:
CSCI101A -
Homework 2 - Fall 2004
|
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 should be commented as specified
in this document, including pre- and post-condition |
|
Style |
10 |
The source code should use meaningful variable
names (identifiers) and is indented (spaced out) correctly. |
|
Design |
10 |
Appropriate data types and control structures
(decisions, loops) are used. |
|
Modularity |
10 |
The program has
appropriate modularity |
|
Output |
10 |
Screen prompts and outputs (user interface)
should be user-friendly. |
|
Correctness |
10 |
The program compiles with 0 errors and 0
warnings and outputs correct results. |
|
Completeness |
10 |
The program should be complete. |
|
Test |
10 |
Comments in the code explain how the code was
tested. |