PART 1:
-
In this section, I debug the codes in file FunWithIntArrays.java.The original file suppose to create an array, copy itself, get the max and min element in the array, calculate the average value, and sort the array in ascending order.
-
FunWithIntArrays.java contains the code I wrote to debug the original file to accomplish its original goals.
-
I learn to fix the bugs in original files by fix-test each error message one by one. I also learn to pay attention to the syntax errors that are easy to overlook.
PART2:
-
In this section I wrote a test program to test the edge case for an unknown original file CaesarWithBugs.class.
-
Part2Tester.java contains the code I wrote to test the edge cases in CaesarWithBugs.class. Such as large positive and large negative number.
-
I learn to write tester for my own program to check its correctness base on some edge cases. I found it is easier compare to test it by hand.
PART3:
-
In this section I wrote 3 different types methods to encrypt and decrypt the same message and compare their speed.
-
Caesar.java contains 6 methods to encrypt and decrypt the messages. 2 of them are written using String operation, 2 used char array, and 2 used StringBuilder class.
-
I learn that it is the fastest to use char array or StringBuilder to manipulate the elements in string because they are both mutable. It can make my code more efficient.