CSCI 201 Spring 2001

Assignment 4

Program 1: Work problem number 6.5 on page 270 of the text

Write a program called madlibs.cpp to perform the task described in problem 6.5. Use the file mad.in as the input file. The output of your program should look like the sample output on page 271 of your text. As shown in that example, the output file created by your program must be read and displayed for the user. Line breaks should be inserted as appropriate for good formatting when displaying the output file. A method for doing this is discussed in the problem. Note that because we do not know a method for reading entire lines from a file, you will have to recreated the line breaks when displaying the output file. The program madlibs.cpp must be turned in by transferring it to your ftp directory for this class. Only the source code file should be turned in and it must be named madlibs.cpp.

Programming Style

Note that 10% of your program grade is based on the readability of your program. This includes things like style, comments, and the naming of variables and functions. Make sure you include a comment at the top of each program with your name, course and purpose of the program specified.

// Name: YOUR NAME HERE // // Course: CSCI 201 // // Purpose: purpose of program here //