(Latest Revision: 10/05/2016)

SECOND CS 1500 SOLO PROGRAM: Using Multiway Decision to Suggest Stories

Your assignment is to write a program whose purpose is to input an integer signifying a month of the year, and to output the title and author(s) of a children's story that relates to the season in which the month (mostly) falls.

Here is a list of the months, and the books to be suggested corresponding to each month. (Note that there are only four books in total, one for each season.) You must write the program so the output has a very specific form and content. Refer to this script to learn, in very complete detail, everything there is to know about what the output of the program should be, including the response that the program must give to every possible integer input.

Make sure to write the program so that it inputs only one integer. (For example, don't put any loops into this program.) When I test the programs of all the students in the class, I will need to use special techniques (a script that utilizes redirection from prepared files of input). In effect, another program will test your program, and the programs of all your classmates. This requires that all the student programs behave exactly the same way, especially when they read input.

TESTING AND CORRECTNESS:

Your program will lose significant credit if it doesn't work correctly on all possible inputs. Your script must show that you tested for all of the types of errors that the program is supposed to catch. (Refer to the script to gain an understanding of which errors have to be caught, and how the program has to react to them. Also, your script must show that you tested enough integer inputs to get all the possible outputs - all the books, plus the error message too. With regard to testing for bad input, your script must show a test for at least one integer that is smaller than 1, and at least one integer that is greater than 12. My procedures will test your program exhaustively.

DESIGN DETAILS:

For the number that your program inputs, use an int variable.

Use C++ if-else-logic or C++ if-logic to program the decisions that determine what output statements the program writes in response to the integer the user inputs. No switch statements are allowed. Without fail, read all the assigned readings in your textbook up to and including section 3.2 (Multiway Branches) before you start designing the solution to this programming problem. Think about the different kinds of if-else logic the text book discusses. Try to figure out a non-complicated way of writing this program. If you get started and the program you are writing begins to get quite complicated, you are probably making things much harder than you need to. Ask me to have a look at your design in progress, if you like. Maybe I can give you some helpful suggestions that will make your job easier. Whatever you do, keep on coming to class, to see discussion of this kind of C++ programming, and possible discussions of this assignment itself.

There are easy ways to do this assignment, and hard ways. The easy way is for the student to have the discipline to begin working on the assignment right away, to do a little bit of the work on it every day, and to ask me questions when they come up. Procrastinating is probably the worst approach. When it's a computer program, one can't "fake it." Either the program does what it's supposed to do, or it doesn't.


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.)