OverviewScheduleResourcesAssignmentsHome

CSC 296A: C++ as a Second Language, Fall 2005

Assignments

Monday, September 5
Project 1: do Exercise 5-1 (page 99).
Friday, September 16
Chapter 8: Exercises 2, 3, 4, 6, 7, and 8.
Monday, September 26

Project 2: Random Text Generator

Write a complete C++ program which implements the random text generation algorithm discussed in class. Here is a sample run (user input in italics):

Welcome to the Random Text Generator

input file? seashells.txt
length of context? 2
length of output? 40

ashe seashore. sells by thells she seash
				

In this example, the input file seashells.txt contains a single line: she sells seashells by the seashore.

Brief Algorithm Description: Read the input file character by character and create a map from each sequence of k characters (where k is the given context length) to a list of each following character (preserving duplicates). At the end of the file, append a space and wrap around to the first k characters (this avoids the problem of what to do at the end). Now choose a random starting sequence of length k, then repeatedly generate a new character by randomly choosing from the list of characters that can follow that sequence. Do this until the desired output length has been generated (sent to cout).

Monday, October 10

Project 3: Number Classes

You should approach this project in two phases. In each, the goal will be to integrate your new type(s) into the language as much as possible, so that they have the same "feel" as the built-in numeric types. Part of this will be a design task, so this project will be deliberately underspecified.

Monday, October 10

Final Exam

OverviewScheduleResourcesAssignmentsHome

Valid HTML 4.01!Valid CSS!DePauw University, Computer Science Department, Fall 2005
Maintained by Brian Howard (bhoward@depauw.edu). Last updated