翰林国际教育全网首发
力争超快速发布最全资料
助你在升学路上一帆风顺
为你的未来保驾护航
此套题仅 p II含有简答题,
共计时1小时45分钟,共4题
占总分50%
每道大题可能含有不同数量的小题
完整版下载链接见文末
1)A travel agency maintains a list of information about airline flights. Flight information includes a departure time and an arrival time. You may assume that the two times occur on the same day. These times are represented by objects of the Time class.
The declaration for the Time class is shown below. It includes a method minutesUntil that returns the difference (in minutes) between the current Time object and another Time object.
For example, assume that t1 and t2 are Time objects where t1 represents 1:00 P.M. and t2 represents 2:15 P.M. The call t1.minutesUntil(t2) will return 75 and the call t2.minutesUntil(t1) will return -75.
The declaration for the Flight class is shown below. It has methods to access the departure time and the arrival time of a flight. You may assume that the departure time of a flight is earlier than its arrival time.
A trip consists of a sequence of flights and is represented by the Trip class. The Trip class contains an ArrayList of Flight objects that are stored in chronological order. You may assume that for each flight after the first flight in the list, the departure time of the flight is later than the arrival time of the preceding flight in the list. A partial declaration of the Trip class is shown below. You will write two methods for the Trip class.
© 2024. All Rights Reserved. 沪ICP备2023009024号-1