FIFTH CS 1500 SOLO PROGRAM: Laying Bricks
The purpose of this programming assignment is to get more
practice writing and using loops.
Your assignment is to write a program that "makes a brick wall"
for the user.
The program prompts the user for a width and a number of courses. These
numbers are the width and height of the wall, measured in numbers of whole
bricks. In this exercise, there will be no provision for partial brick widths
The program "outputs a brick wall" having the dimensions given by the user.
Look at the
of my solution program to see what the appearance the brick wall must
For this exercise, your output must be just like the output of the sample. In
particular, your bricks must be the same size and shape as the
bricks in the sample, and your walls must contain single layers of
mortar (asterisks) in the appropriate locations just as the sample
shows. Also, your walls are not allowed to have mortar anywhere on
the periphery. (The periphery is the top, bottom, and the sides.)
THE DESIGN OF THE PROGRAM:
If you wish, you may use
this structure chart
this function plan
guidelines for your program design.
I expect you to employ good principles of top-down design. Substantial credit
will be withheld if you do not create a program that uses functions
I'll discuss some things in class that I think will help you in your efforts
to design a solution to this problem.
Also, you can look at the programs
to see C++ code with some similarities to the code you need to write.
FORM AND FORMATTING REQUIREMENTS:
Write appropriate header comments for each of your functions. Header comments
are the comments that appear at the beginning of the function, telling what
it's purpose is and what the preconditions and postconditions are, and so
forth. You may pattern your header comments after the example code in your
text book, or you may use
as your guide.
At the beginning of your program file put a header comment like
/* PROGRAM Brick Wall Maker */
Name: Gordon Goodguy
User Name: goodge
Course: CS 1500, Computer Programming I
Instructor: John Sarraille
Date: November 20, 2004
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 "November 20, 2004"
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
WHAT TO TURN IN:
You will be sending me two e-mail messages. Please follow these rules:
Here is the list of things you have to turn in:
- 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
- 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
- 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.
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:
- At the start of class on the
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:
- a (filtered) script, with subject line CS1500,Solo5,script,
showing the results of several runs of the program illustrating
- its results on all appropriate boundary values,
- its results on a representative sample of inputs that are "out
of bounds," and
- its results on a representative sample of inputs that are well
WHEN IS THIS ASSIGNMENT DUE?
Look for the due date in
the class schedule.
(It's at the top level of the class directory.)