Đề thi sát hạch kỹ sư công nghệ thông tin part 5

Bi-Directional List States for Empty List and List Containing Elements Seats are indicated by the class Seat, which extends ListElement. A seat number is assigned to each seat. The class SeatManager is used to implement methods for carrying out the administration rules. The lists of free seats and occupied seats are, respectively, freeSeats and occupiedSeats. Seat instances become elements of each list. Occupied seats are registered in occupiedSeats. The list is managed so that the seats are sorted from the one with the shortest usage time to the one with the longest usage time. SeatManager implements the following public methods | Empty list Fig. Bi-Directional List States for Empty List and List Containing Elements Trung Jam Sat hg long nghe thong tin yà Hoi trợ đào tạo Seats are indicated by the class Seat which extends ListElement. A seat number is assigned to each seat. The class SeatManager is used to implement methods for carrying out the administration rules. @ The lists of free seats and occupied seats are respectively freeSeats and occupiedSeats. Seat instances become elements of each list. Occupied seats are registered in occupiedSeats. The list is managed so that the seats are sorted from the one with the shortest usage time to the one with the longest usage time. SeatManager implements the following public methods. http checkin Confirms that a student desiring a seat who is specified in an argument is not already using a seat. If there is a free seat in freeSeats free seats list that seat is assigned to the student desiring a seat. Otherwise a seat which has been used for more than one hour is assigned. The assigned seat is registered as the first element in occupiedSeats occupied seats list and that Seat instance is returned. If there are no available seats null is returned. 50 checkout Deletes the seat used by the user specified in the argument from occupiedSeats moves it back to freeSeats and returns true. If the specified user is not found in occupiedSeats false is returned. First the class ListElement and the class Seat were implemented and a unit test was performed to confirm that operations were correct. Next a test was performed with the class SeatManager implemented. In this test a problem was discovered wherein a single student could use multiple seats at the same time. In other respects normal operations were confirmed. Program 1 Trung public class ListElement private ListElement prev next public ListElement prev next this đào tạo public ListElement nextElement return next public ListElement previousElement return prev public void insertBefore .

Không thể tạo bản xem trước, hãy bấm tải xuống
TÀI LIỆU MỚI ĐĂNG
Đã phát hiện trình chặn quảng cáo AdBlock
Trang web này phụ thuộc vào doanh thu từ số lần hiển thị quảng cáo để tồn tại. Vui lòng tắt trình chặn quảng cáo của bạn hoặc tạm dừng tính năng chặn quảng cáo cho trang web này.