Text Scrambling Program: Preserve First and Last Letters - Prof. Joseph D. Sloan, Assignments of Computer Science

An intriguing assignment from the university of cambridge that explores the human mind's ability to read words despite the order of their letters. The task involves creating a program that scambles text by randomly altering letters within a word while preserving the first and last letters and the case of the letters. The document also emphasizes the importance of using control structures and working with text, as well as the use of subroutines and commenting the code. Students are expected to submit a structure chart and their code electronically, along with their names and time estimates. This assignment is worth three routine homework grades and is due on april 15.

Typology: Assignments

Pre 2010

Uploaded on 08/17/2009

koofers-user-d5q
koofers-user-d5q 🇺🇸

10 documents

1 / 1

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
Scramble Text Assignment
Consider the following:
Aoccdrnig to a rscheearch at Cmabrigde Uinervtisy, it deosn’t
mttaer in waht oredr the ltteers in a wrod are, the olny iprmoetnt
tihng is taht the frist and lsat ltteer be at the rghit pclae. The
rset can be a toatl mses and you can sitll raed it wouthit
porbelm. This is bcuseae the huamn mind deos not raed ervey
lteter by istlef, but the word as a wlohe.
(See http://www.mrc-cbu.cam.ac.uk/people/matt.davis/cmabridge/ for more information.)
This statement makes an interesting observation, but you might not be convinced by a
single example. Your task is to create a program that will take the text in a file and
generate a new example. You could use this to convince yourself of the validity of this
statement. And in doing so, you’ll also get a lot of practice using control structures and
working with text.
Your code should prompt the user for names for a source file and a destination file. It
should read the source file and scramble the text writing the results out to the destination
file. Scrambling should be consistent with the example above. In particular, the first and
last letters of a word should not be change, the case of the letters should not be altered,
and punctuation should be preserved. The scrambling within a word should be random.
Be sure to appropriately comment your code. Code must be organized making
appropriate use of subroutines. Please submit a structure chart for your code. This may
be hand drawn. Please submit your code electronically including your name as part of
the file name. Don’t forget to pledge your work and include with your code times
estimates for writing the code. You must work in pairs on this assignment or justify,
before the fact, why you cannot work as part of a team.
This project will count as three routine homework assignments.
Due: Wednesday, April 15

Partial preview of the text

Download Text Scrambling Program: Preserve First and Last Letters - Prof. Joseph D. Sloan and more Assignments Computer Science in PDF only on Docsity!

Scramble Text Assignment

Consider the following:

Aoccdrnig to a rscheearch at Cmabrigde Uinervtisy, it deosn’t

mttaer in waht oredr the ltteers in a wrod are, the olny iprmoetnt

tihng is taht the frist and lsat ltteer be at the rghit pclae. The

rset can be a toatl mses and you can sitll raed it wouthit

porbelm. This is bcuseae the huamn mind deos not raed ervey

lteter by istlef, but the word as a wlohe.

(See http://www.mrc-cbu.cam.ac.uk/people/matt.davis/cmabridge/ for more information.) This statement makes an interesting observation, but you might not be convinced by a single example. Your task is to create a program that will take the text in a file and generate a new example. You could use this to convince yourself of the validity of this statement. And in doing so, you’ll also get a lot of practice using control structures and working with text. Your code should prompt the user for names for a source file and a destination file. It should read the source file and scramble the text writing the results out to the destination file. Scrambling should be consistent with the example above. In particular, the first and last letters of a word should not be change, the case of the letters should not be altered, and punctuation should be preserved. The scrambling within a word should be random. Be sure to appropriately comment your code. Code must be organized making appropriate use of subroutines. Please submit a structure chart for your code. This may be hand drawn. Please submit your code electronically including your name as part of the file name. Don’t forget to pledge your work and include with your code times estimates for writing the code. You must work in pairs on this assignment or justify, before the fact, why you cannot work as part of a team. This project will count as three routine homework assignments. Due: Wednesday, April 1 5