| CS150 -- Lab 7: Literary Monkeys |
|
|
OverviewA 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. AcknowledgementThis laboratory assignment is based on an exercise from Program Development and Design Using C++, 2nd ed. by Gary Bronson. ProcedureIt 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:
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 |