CSC 121A Lab 13 - Spring 2005
Thursday, April 7, 2005
Due: Wednesday, April 13, 2005, 5:00PM
[Course home page]
[Java API Documentation]
Work on the following exercises. Complete for homework whatever you
don't finish in lab. You do not have to upload and hand in any
print outs of your work in lab. Just upload your completed programs
to VikingWeb by next Wednesday.
Don't leave this homework until next Tuesday. Some of the problems
may require a bit of thought. Get started on them early.
You may work in pairs for all parts of this assignment,
including the homework exercises.
Lab and Homework Exercises
- Exercise 9.6 (page 330)
- Exercise 9.8 (page 331)
- Exercise 9.11 (page 332)
- Exercise 9.15 (page 333)
- Exercise 10.4 (page 354) (The bubble sort algorithm is on
page 313 of the book.)
- Exercise 10.10 (page 356) (First concentrate on reading in
the strings and displaying them as a list. Then worry about
sorting. When reading strings into a buffer (array of characters),
you need to make sure the input doesn't exceed the bounds of
the allocated memory. Use the "%10s" format specifier for the
scanf function, where the 10 could be any number that specifies
the maximum number of characters to read in. Remember you also
need one character to store the null character '\0' at the end
of the string so if your array is:
char buf[100]
then use something like: scanf( "%99s", buf ); buf[99] = '\0';
. Notice you don't have to pass the
address of the string variable to scanf because, as an array of
characters, it is already really a pointer.)
- Exercise 9.12 (page 332) (continuation of 9.11 that you worked
on above)
- Exercise 9.13 (page 332)
Last modified: Mon Apr 11 12:22:15 EDT 2005