University of Southern California ISE 582: Web Technology for Industrial Engineering

advertisement
University of Southern California
Daniel J. Epstein Department of Industrial and Systems Engineering
ISE 582: Web Technology for Industrial Engineering
Homework 4 – Part 2: Due 17 Oct 2002
“All the Weasleys have red hair, freckles, and more children than they can
afford."
-- Draco Malfoy
As you know (if you attended class on October 10th), we created a java class called
DemoVector.java that reads the attributes of all the Weasley children from the
Weasleys.txt file. We also scrambled the order of the Weasley children, and showed
how one could replace “Ronald” by “Harry” in the vector. The source code is
located at:
http://www-classes.usc.edu/engr/ise/582/handouts/lecture7
You have two alternatives for part II of homework 4. You may:
[1]
Use the DemoVector.java file as a basis to create a version of the code that
would read in the Weasley data from Weasleys.txt, and create a vector of the
Weasleys, sorted by age. Then, create a method that would insert any wizard at the
appropriate point, preserving the ordering of the wizards by age. Demonstrate that
your method works, by inserting Harry into the vector.
OR
[2]
Use vectors to implement a sorted list to solve part 2 or 3 of the first part of
homework 4.
(40 points)
Download