Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 5be6716

Browse files
Merge pull request HarryDulaney#27 from HarryDulaney/Add_Chapter_22_23_24_25_answers
Fixed Exercise14_17.java, added import for FXMLLoader + Removed JUnit...
2 parents de31a21 + 40712f8 commit 5be6716

File tree

5 files changed

+28
-13
lines changed

5 files changed

+28
-13
lines changed

‎ch_08/Exercise08_13.java‎

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,5 @@
11
package ch_08;
22

3-
import org.junit.Test;
4-
5-
import java.awt.*;
63
import java.util.*;
74

85
/**
@@ -52,4 +49,4 @@ public static int[] locateLargest(double[][] a) {
5249
}
5350
return largeIdx;
5451
}
55-
}
52+
}

‎ch_14/Exercise14_17.java‎

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,14 @@
1-
package ch_14.exercise14_17;
1+
package ch_14;
22

33
import javafx.application.Application;
4-
import javafx.collections.ObservableList;
5-
import javafx.scene.Node;
4+
import javafx.fxml.FXMLLoader;
5+
import javafx.scene.Parent;
66
import javafx.scene.Scene;
7-
import javafx.scene.layout.Pane;
8-
import javafx.scene.paint.Color;
9-
import javafx.scene.shape.Arc;
10-
import javafx.scene.shape.Circle;
11-
import javafx.scene.shape.Line;
127
import javafx.stage.Stage;
138

9+
import java.io.FileInputStream;
10+
import java.io.IOException;
11+
1412
/**
1513
* 14.17 (Game: hangman) Write a program that displays a drawing for the popular hangman game, as shown in Figure 14.48a.
1614
*/

‎ch_18/Exercise18_01.java‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
import java.math.BigInteger;
44
import java.util.Scanner;
55

6-
import static org.junit.Assert.*;
6+
import static resources.lib.UnitTest.*;
77

88
/**
99
* *18.1 (Factorial) Using the BigInteger class introduced in Section 10.9, you can

‎resources/lib/UnitTest.java‎

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
package resources.lib;
2+
3+
import java.math.BigInteger;
4+
5+
public class UnitTest {
6+
7+
public static void assertEquals(BigInteger b1, BigInteger b2) {
8+
if (!b1.equals(b2)) {
9+
throw new UnitTestException("Failed Unit Test, Expected: " + b1 + ", but got: " + b2);
10+
}
11+
}
12+
}

‎resources/lib/UnitTestException.java‎

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
package resources.lib;
2+
3+
public class UnitTestException extends AssertionError {
4+
5+
public UnitTestException(Object detailMessage) {
6+
super(detailMessage);
7+
}
8+
}

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /