(Latest Revision: November 12, 2016)
FIFTH CS 1500 SOLO PROGRAM: Tiled Surface
OBJECTIVE:
The purpose of this programming assignment is to get more practice
designing programs with functions, as well as writing code that uses
control structures like if-else statements and loops.
THE ASSIGNMENT:
Your assignment is to write a program that makes a
pattern of tiles for the user.
INPUT:
The program prompts the user for a length and a width. These
numbers are the length and width of the pattern, measured in
numbers of whole tiles. There does not need to be any
provision for partial tile lengths or partial tile widths.
OUTPUT:
The program "outputs a tile pattern" having the dimensions given
by the user.
SAMPLE RUNS:
Look the
sample runs
of my solution program.
THE DESIGN OF THE PROGRAM:
For this assignment, you may create your own design of the program,
or use my
Program
Skeleton
and
Design
Suggestions.
In any case, you must employ good principles of top-down design.
I will withhold substantial credit if you do not create a
program that uses functions appropriately.
Note: You are NOT allowed to use ANY global variables in this program. You
are cautioned to use functions appropriately. That means your program
has to contain several functions. I would expect it to have at least
five functions, including main. Of course, the number of functions
that your program uses depends on the details of your design.
Follow these rules:
- A function must do ONE thing well (only one main job).
- A function must not contain more than 24 lines of code
(including blank lines, and remember lines are not allowed to be
more than about 75 characters long).
- Almost all functions in a program should have parameters and/or
return values. If not, there's probably something seriously
wrong with the design.
If you want help getting started on the design of
the program, check out my design
suggestions. Then, if you work with my
program skeleton,
you'll see that it embodies those design suggestions.
If you get familiar with both of those documents, then I
think you'll be able to receive a lot of guidance
from the directions in the skeleton, which will enable you to
write a working version of the program without a lot of difficulty.
Of course, you can also ask me questions in class or during office hours.
Also, you can look at the programs
stars.cpp,
varStars.cpp,
and
the development of the checks program
to see some C++ code with similarities to the code you need to
write.
FORM AND FORMATTING REQUIREMENTS:
At the beginning of your program file put a header comment like
this:
/* PROGRAM Tiling Maker */
/*
Name: Gordon Goodguy
User Name: goodge
Course: CS 1500, Computer Programming I
Instructor: John Sarraille
Date: January 1, 1970
*/
Of course, in place of "Gordon Goodguy," you must put your own full
name. In place of "goodge" put your user (login) name. In place of
the unix epoch date of "January 1, 1970" put the date that you
finished the program. Note that the comment delimiters
/* and */ are important. They need to be placed correctly or you will
get compiler errors.
WHAT TO TURN IN:
You will send 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 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.
- Before midnight on the the due
date send me the following by e-mail:
- A copy of the source code (C++ code) with subject line:
CS1500Solo5Source
- a (filtered) script, with subject line:
CS1500Solo5Script
showing the results of several runs of the program illustrating:
- its results on all appropriate boundary values
(each dimension has an upper and lower bound),
- its results on a representative sample of inputs that are "out
of bounds" (do you get error message when you are
supposed to?), and
- its results on a representative sample of inputs that are well
within bounds (does the program work right when both inputs
are well in bounds?).
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.)