由于我的英语能力有限,只能翻译成这样了,下面是英文原文:
做EXERCISE 1要求用TREEMAP 或者HASHMAP来做,我也不是很清楚,好象是说要先把DRIVERS DETAILS先列好了,然后再调用出来,后面有点解释,估计有用
Exercise 1 (Trip logs)
Electronic submission To assist the University transport office, design, implement and test a complete console application that reads information about journeys made by vehicles from standard input and writes a summary of the journeys made to standard output. The input consists of a sequence of zero or more lines on standard input, terminating at end of file. Each line of standard input contains information about a single journey made on a particular day. Specifically, each line contains the registration number, the driver's name, the starting point, the destination, the initial kilometres (on the odometer) and the final kilometres. (The registration number, the driver's name and the destination may each be assumed to be a single word.) A possible input file might be: 222FFF Rodney Nathan City 10500 10530
123EFG Andrew Nathan Southport 12100 12300
123EFG Rodney Nathan Logan 12300 12350
567GGH Colin Logan GoldCoast 21345 21495
222FFF David Nathan City 10530 10570
Lines that are obviously incorrect (e.g., wrong number of tokens, non-integer kilometres, final kilometres less than the initial kilometres) starting point same as destination should be quietly ignored. The application must display the total distance travelled by all vehicles on that day and the total distance travelled by each driver on that day, arranged alphabetically by the driver's name. For example, the output corresponding to the above input should be: Andrew       200 km
David         40 km
Colin        150 km
Rodney        80 kmTotal        470 km
Names should be left-justified, distances should be right-justified. You may assume that all names are at most 12 characters long, and that each driver travels less than 10,000 km in total. Your solution must be well-designed and thoroughly documented using Javadoc. It should be thoroughly tested on your own, comprehensive, test data files. Hints Store the total distance travelled by each driver in an object together with the driver's name. Implement a mapping from driver names to corresponding objects. This can be done using the collections framework and the Map interface, or by an array of objects and an explicit search method. Solve the problem one step at a time. Initially ignore output sorting. Initially ignore number formatting. (5 s) Exercise 2 (Block sliding puzzle)
Electronic submission 
This is the second of a series of exercises to design and implement a graphical implementation of a popular block sliding puzzle. As before, each problem consists of several blocks of size 1x1, 2x1, 1x2 or 2x2 placed in a 5x4 grid. Naturally, blocks may never overlap! Each problem has exactly one 2x2 block. Blocks may move left, right, up or down provided there is nothing stopping them. Each problem has a single ed exit from the grid. The goal is to move blocks around until the single 2x2 block reaches the exit. The purpose of this second programming exercise is to design, implement and test a terminal application that allows a user to try and solve a given problem. The application should read a problem from a file, draw the initial board, repeatedly read moves from standard input, and print an appropriate message if and when the problem is solved. The name of the file containing the problem should be provided as a command-line argument. After reading each move, the program should make the move and draw the resulting board. If a move is illegal, it should be quietly ignored (and the board should not be redrawn), i.e., you must validate that user input is correct. Each move is entered on a separate line. The form of each move is as follows: bxyz... Here, b is a block identifier, a single character, in either upper or lower case. Each character x, y, z, represents one of the directions u, d, l or r, in either upper or lower case. Directions may be repeated in a single move. The move terminates normally when all directions have been followed or when the next direction is not possible. For example, a possible move is: Alurd If this move succeeds completely, it moves block A left, up, right and down, i.e., back to its starting point. Problem descriptions have the same form as in Project 1. Example problems are provided in directory problems. You may assume that problem descriptions are correct, i.e., you do not have to perform any input validation on problem descriptions. Here is a possible execution of the application. User input is shown in italics. > java Puzzle problems/problem0
 ----
|.AA.|
|.AA.|
|....|
|....|
|....|
 -++-
Allll
 ----
|AA..|
|AA..|
|....|
|....|
|....|
 -++-
addrrl
 ----
|....|
|....|
|.AA.|
|.AA.|
|....|
 -++-
aD
 ----
|....|
|....|
|....|
|.AA.|
|.AA.|
 -++-
Solved in 3 moves (min is 1).
>
The exact form of the output is not important, but it should be neat and tidy. There is no need for unnecessary prompts and messages. There is no need to go to a lot of trouble over the output, because it will soon be replaced by graphical output. Your solution must be well-designed and thoroughly documented using Javadoc. It should be thoroughly tested. Hints Solve the problem one step at a time; do not attempt to solve it all at once. For example, initially assume that each command has the form bx, where x is a single atomic move. Initially assume all characters in commands are upper case. Initially ignore the need to recognise when the problem is solved. As in Project 1, it is desirable to use at least three classes: Block (as provided previously), Board and Puzzle. Class Puzzle is the top-level class responsible for reading the problem description, reading user input, and printing the board. Other classes may also be useful. It is probably necessary to extend your definition of class Board from Project 1 by adding the following methods: /** 
 * Returns whether or not a block can move in a direction. 
 * @param id The identifier of the block to move. 
 * @param dir The direction to move the block. 
 */
public boolean canMove(String id, String dir)/**
 * Moves a block in a direction.  Requires canMove(id, dir) to hold.
 */
public void move(String id, String dir)/**
 * Returns whether or not the problem is solved.
 */
public boolean solved()
Some students may find the design and implementation of these three methods challenging. To help them, we present a partial implementation of method move(). This implementation assumes that class Board contains a 2-dimensional array, grid, which contains references to blocks. It assumes that character dirc is the direction to move (character dirc is derived from the single-character string dir), that block is the block to be moved, and that its initial position is (row, col). It uses a switch-statement to choose between the four possible directions. switch (dirc) {
    case 'u': // Up
        // Move the block one position up
        for (int r = row; r < row+block.height(); r++)
            for (int c = col; c < col+block.width(); c++)
                grid[r-1][c] = block;
        // Clear the array elements below the block
        for (int c = col; c < col+block.width(); c++)
            grid[row+block.height()-1][c] = null;
        // Update the block position
        block.setPosition(row-1, col);
        // Exit the switch statement
        break;
You may need to think explicitly about how to find the block with the identifier given in a move. It will help you to solve the problem if you prepare pseudocode designs of critical methods such as the ones that read, validate and apply moves from standard input. You must submit one such pseudocode design with your solution.