Read Java Text Book: pp. 644-652
NOTE: Java Text Book page 1 is page 35 of the PDF. In the assignments and labs, the page numbers are the actual book page numbers (not the PDF page numbers). To calculate the PDF page number, just add 34 to the actual book page number!
Coefficients.java (PART I - Try to calculate B_20. Notice how long it takes. Then, modify the a(l, k) method to use the a[k][l] array instead of calling itself recursively. Notice the speedup. Part II - After making this change, see what the largest Bernoulli number you can calculate is.)
Coefficients2.java (PART III - This implementation saves a lot of memory by using only one array. It is also a bit faster than the completed implementation from part I. See what the largest Bernoulli number you can calculate with this implementation is.)
Coefficients.java (Modify Coefficients.java to print only the Bernoulli numbers. Then time the calculation of B_1000 using System.currentTimeMillis().)
Parentheses.java (Fill in the blanks to complete the parentheses syntax checker.)
Calc4.java (Set driveLetter , javaBin , and expressionFolder for your computer, as described in the comments at the top of Calc4.java. Run Calc4 on your computer.)
Fraction.java (Fill in the blanks: BLANK_0 through BLANK_7)
FractionSum.java (Fill in the blanks: BLANK_0 and BLANK_1)
public class FractionTest { public static void main(String[] args) { // f1 = 3/4 int n1 = 3; int d1 = 4; // f2 = 1/2 int n2 = 1; int d2 = 2; // f3 = f1 + f2 = n1/d1 + n2/d2 = n3/d3 // Here you should calculate n3 and d3 correctly : int n3 = 123; int d3 = 456; System.out.print(n1 + "/" + d1); System.out.print(" + "); System.out.print(n2 + "/" + d2); System.out.print(" = "); System.out.print(n3 + "/" + d3); } }