(This assignment is adapted from one that appears in A
Computer Science Tapestry by Owen Astrachan)
(
Latest Revision:
October 19, 2016
)
THIRD CS 1500 SOLO PROGRAM
Column of Birds Assignment: Writing A Simple Loop and Some Functions
OBJECTIVE:
The purpose of this programming assignment is to give you practice writing
and using loops in your programs.
THE ASSIGNMENT:
Simply stated, your assignment is to write a program that gets an integer N
from the user and then draws a column containing N ascii bird figures.
INPUT, OUTPUT, AND PROCESSING:
The program must begin by writing some information explaining the
purpose of the program and a general description of how to use the
program.
The program must then prompt for and read the number N.
After getting N, the program must do some error-checking. If N is not between
1 and 7, inclusive, then the program must output an appropriate error message
and stop. If N is within the legal range, then the program must draw a
'column' containing N ascii bird figure(s), and certain other lines,
made either of exclamation points, @-signs, or equal signs. (See the sample
outputs to determine exactly what the program output needs to be.
The output of your program has to be exactly like the sample output.)
EXAMPLE OUTPUT:
Examine the
sample script
to see how the output of the program should be.
DESIGN:
I have prepared a
skeleton program
that you should use as a starting point for your solution to this programming
problem.
The skeleton has four functions to fill in, including the main() function.
You can create a program with a good design if you follow the directions found
inside the skeleton.
You can examine
this program
and
this script
to get more hints about how your finished program should look.
Be sure to attend class to get additional information that will help you
with this assignment.
TESTING:
I expect you to make a test script for the program that shows good data
coverage. It won't be enough just to duplicate the tests in the sample
script. The boundary data values for input to this program are 1 and 7. It's
important to test programs to make sure they work correctly when inputs
are on or near boundaries. Also, there are different error messages
and those have to be tested.
So test at least one negative input value, and test the boundaries
by trying 0, 1, 7, and 8 as possible inputs.
Also try at least one ordinary, average kind of input, like 3, 4, or 5.
You will lose significant credit if
you do not perform adequate testing.
WHAT TO TURN IN:
You will be sending me two e-mail messages. Please follow these
rules:
- Always send me e-mail as plain text in the main message body.
Never send me attachments.
- Always use the exact subject line I specify for each
message. (I often get hundreds of e-mail messages in a week. The
subject line allows me to find and sort messages.) You will lose a
significant number of points on the assignment if you use the wrong
subject line.
- Be very careful when you send the e-mail. You may use the
instructions in your
Hello World! lab excercise
for guidance. Of course, you will need to make the obvious changes to
those directions -- you have to use the correct subject line and
filename.
- Always send yourself a copy of each e-mail message you send to me,
check immediately to see if you receive the message intact, and
check within a few minutes to see if you have received e-mail notifiying
you about an undeliverable message. You are
responsible for sending e-mail correctly.
Here is the list of things that you have to turn in:
- At the start of class on the
due date
place the following item on the "counter" in front of me:
- a hardcopy (printed listing) of your program (the C++ source code).
Make sure all the code is properly formatted and that it all shows
on the paper. (You can't put more than about 75 characters on any
line, and don't put any tab characters in your program.)
- Before midnight on the due date
send me the following by e-mail:
- A copy of the source code (C++ code) with subject line:
CS1500Solo3Source
and
- a (filtered) script, with subject line
CS1500Solo3Script
showing the results of adequate testing of the program. (See
the section above entitled "TESTING".)
Note that there are no spaces in the subject lines given. It is important
that you do not insert any spaces. My e-mail address is:
john@ishi.csustan.edu
WHEN IS THIS ASSIGNMENT DUE?
Look for the due date in
the class schedule.
(It's at the top level of the class directory.)