(This assignment is adapted from one that appears in A Computer Science Tapestry by Owen Astrachan)

( Latest Revision: 10/24/2012 )

FOURTH CS 1500 SOLO PROGRAM
Stack of Jack O'Lanterns Assignment: Writing A Simple Loop


OBJECTIVE:

The purpose of this programming assignment is to give you practice writing and using loops in your programs.


THE ASSIGNMENT:

Basically, your assignment is to write a program that gets an integer N from the user and then draws N "jack o'lanterns" in a stack.


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 6, inclusive, then the program must output an appropriate error message and stop. If N is within the legal range, then the program must draw the jack o'lantern N times. After drawing the jack o'lanterns, it must draw a little "base" so that it looks like the jack o' lanterns are standing on something.


EXAMPLE OUTPUT:

Examine the sample script to get an idea of how it should look when you run the program.

(Caution: The sample script is not meant to illustrate thorough testing of the program.)


DESIGN:

I have prepared a shell program that you should use as a starting point for your solution to this programming problem.

The shell has three 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 shell.

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. I will discuss that concept in class. The basic idea is: It is your responsibility to devise and carry out adequate tests. You must do something more than just copy the tests I performed in my little sample script. You will lose significant credit if you do not perform adequate testing. However, I will give you information to help you figure out what tests you need to do.


WHAT TO TURN IN:

You will be sending me two e-mail messages. Please follow these rules: Here is the list of things that you have to turn in: 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.)