CS150 -- Lab 7: Literary Monkeys



->Courses
->CS150
-->Homework
-->Lab 1
-->Lab 2
-->Lab 3
-->Lab 4
-->Lab 5
-->Lab 6
->Lab 7
->Electronic Submission
->Old Exams
->C++ Examples
->MSVC Info
->Software
->Tentative Schedule
->Course Policies

[Courses]
[Rich][Home][Rich]
[Author]

Fall Quarter 2000

Hydrogen is a colorless, odorless gas which, given enough time, turns into people. -- Henry Hiebert

Overview

A number of scientists, unwilling to consider a belief in a higher power, have been forced to devise an explanation for human existance. One popular explanation goes like this: "Anything, no matter how unlikely, is possible given a sufficient amount of time." In this assignment, you will attempt to apply this same reasoning to an event that is much more likely than the creation of human beings from hydrogen gas.

Acknowledgement

This laboratory assignment is based on an exercise from Program Development and Design Using C++, 2nd ed. by Gary Bronson.

Procedure

It has been said that a monkey pushing keys at random on a typewriter could, given enough time, reproduce the works of Shakespeare. Write a program to simulate this by selecting characters at random and displaying them. Count (you may want to have your program do this for you) the number of letters displayed before one of these two letter words is displayed: at, is, he, we, up, or on.

How many characters are displayed before the quote at the top of this assignment ("Hydrogen is a colorless...") is displayed?

Lab Report (due beginning of week 10 lab)

The lab report should be self-contained. That is, it should be possible for someone to understand what you did and why without seeing anything other than your report. Your report should include:

  • Purpose
  • Problem Statement
  • Procedure (include the steps in your design procedure, reasons for your design decisions, etc.)
  • Documented source code (you may wish to include this at the end of your report)
  • Sample output from your program
  • Conclusions (problems you encountered, what you learned, suggestions of how the lab could have been better, things you would have done differently, etc.)

Your report should be typed, and as with any report you submit, correct spelling and grammar are required. Be sure to keep copies of all your files, in case something gets lost. It may be wise to keep a diskette backup as well.

Your grade will depend on quality of design and clarity of the code and documentation, as well as whether your program produces the correct results. If you have any questions, consult the instructor.

Office: CC-27C, Phone: 277-7339
Last Updated: July 30, 2000
© 2000 Dr. Christopher C. Taylor