After the lab, you should be proficient at
You will need to copy all the files
from /home/courses/cs111/handouts/lab7
into the directory
you created.
We'll practice writing several Python programs, each in their own text file. Name the files lab7.1.py through lab7.4.py.
Your programs will be graded on correctness, style, efficiency, and how well you tested them. Make sure you adhere to the good development and testing practices we discussed in class. Your code should be readable and your output should be useful and well-formatted.
After you've developed a correct solution to each program, restart IDLE or close and reopen the IDLE "shell" by running the program again (using F5), demonstrate that the program works using several good test cases, and save the output to a file named lab7.x.out, where x is the problem number.
f is for fiddle g is for goose z is for zoo
<count> <word>
The format of the output file may be different from what you expected. The reason that it's in this format is so that we can use a Unix utility to view the data in a different way.
Note that the punctuation (except for apostrophes) has been removed from the files, so you don't need to worry about that. However, you should count, for example, the words "the" and "The" as the same word.
This is a larger program. You will have to break it into smaller pieces, solve (and test) a piece, and then move on to the next piece.
There are three files, copied from the handouts/lab07
directory, for you to test your program on. The files have the ".txt"
extension.
To view the output files you've created, use the
commands more
or cat
. Use them as
more <summary_file>
You should name the summary files with different names to
distinguish the files, e.g., huck_count.dat
. (You can do
that either in your program or using Linux commands.)
For each of your summary files, run the command:
sort -n <summary_file>and report the top 5 most frequently used words in each file in comments in your program. Any surprises in the results?
setCoords
method of
the GraphWin
object to adjust the coordinates of the
window. (See the reference for more information
about setCoords
.)
Screen Capture:
xv
, using the command xv &
.
You've saved the image!
Some previously created images to inspire you:
public_html
directory.
index.html
file into a file
called lab7.html
(in the public_html
directory).
public_html
directory.
lab7.html
in jEdit.
turnin
directory.
(Review the UNIX handout if you don't
remember how to do that.)
labs/lab7
directory; otherwise, the print out will be long and screwed up. You
can move those files back into your lab7
directory after
you've printed. In other words, you should only have the .py
files you wrote and the .out files you created.
I changed this a bit from the original instructions. I can look
at your code and the output files in your turnin
directory to make sure that they're in the correct format. Make sure
not to move those files out of your directory until after
you've copied them into your turnin
directory.
printLab.sh
command to create a file to print out. You
should probably print from the
labs
directory.
Print the file using the lpr
command introduced in the
first lab.
Labs are due at the beginning of Friday's class. You should hand
in the printed copy at the beginning of class, and the electronic
version should be in the turnin
directory before 2:25
p.m. on Friday.
Ask well before the deadline if you need help turning in your assignment!