Tổng hợp tài liệu, ebook Kỹ Thuật Lập Trình tham khảo.
We will write a test program to verify that the data can be read back correctly from a file. To test the read operation, the file to read the data from must already exist. We will make this test program save the data first by using the TestAddressBookWrite class from .
37 trang | Chia sẻ: nguyenlam99 | Ngày: 04/01/2019 | Lượt xem: 908 | Lượt tải: 0
In the previous two versions, we used an array data structure to maintain a collection of Person objects In the third version, we don't use an array at all. Instead, we use a Map from the Java Collection Framework to maintain a collection of Person objects. We use the person's name as the key of a Map entry and the person object as the value of ...
58 trang | Chia sẻ: nguyenlam99 | Ngày: 04/01/2019 | Lượt xem: 923 | Lượt tải: 0
Final Test Since the three operations of add, delete, and search are interrelated, it is critical to test these operations together. We try out various combinations of add, delete, and search operations. Possible Extensions One very useful extension is scanning. Scanning is an operation to visit all elements in the collection. Scanning is usef...
60 trang | Chia sẻ: nguyenlam99 | Ngày: 04/01/2019 | Lượt xem: 1030 | Lượt tải: 0
Possible Extensions One is an integrated user interface where the end user can view both the input document files and the output word list files. Another is the generation of different types of list. In the sample development, we count the number of occurences of each word. Instead, we can generate a list of positions where each word appears in ...
42 trang | Chia sẻ: nguyenlam99 | Ngày: 04/01/2019 | Lượt xem: 919 | Lượt tải: 0
The purpose of Step 2 testing is to verify the correct behavior of an InputHandler. We need to test both successful and unsuccessful cases. We must verify that the door is in fact opened when the valid information is entered. We must also verify that the error message is displayed when there’s an error in input. We should test invalid cases...
41 trang | Chia sẻ: nguyenlam99 | Ngày: 04/01/2019 | Lượt xem: 943 | Lượt tải: 0
Program Review Are all the possible cases handled? Are the input routines easy to use? Will it be better if we allow different formats for entering the date information? Possible Extensions Warn the user, say, by popping a warning window or ringing an alarm, when the due date is approaching. Provide a special form window to enter data (No...
46 trang | Chia sẻ: nguyenlam99 | Ngày: 04/01/2019 | Lượt xem: 922 | Lượt tải: 0
Program Completion Finish the describeRules method Remove all temporary statements Possible Extensions Allow the user to set her desired min and max for secret numbers Allow the user to set the number of guesses allowed Keep the score—the number of guesses made —while playing games and display the average score when the user quits the program
50 trang | Chia sẻ: nguyenlam99 | Ngày: 04/01/2019 | Lượt xem: 933 | Lượt tải: 0
Possible Extensions Morphing the object shape Changing the object color Drawing multiple objects Drawing scrolling text
61 trang | Chia sẻ: nguyenlam99 | Ngày: 04/01/2019 | Lượt xem: 941 | Lượt tải: 0
We will implement the describeProgram method We will format the monthly and total payments to two decimal places using DecimalFormat. Directory: Chapter4/Step5 Source Files (final version): LoanCalculator.java Loan.java
51 trang | Chia sẻ: nguyenlam99 | Ngày: 04/01/2019 | Lượt xem: 1064 | Lượt tải: 0
We will add a program description We will format the monthly and total payments to two decimal places using DecimalFormat. Directory: Chapter3/Step4 Source File: Ch3LoanCalculator.java
47 trang | Chia sẻ: nguyenlam99 | Ngày: 04/01/2019 | Lượt xem: 885 | Lượt tải: 0