diff --git a/src/main/java/src/TasksFrame.java b/src/main/java/src/TasksFrame.java index 18bfa1b..b606bd4 100644 --- a/src/main/java/src/TasksFrame.java +++ b/src/main/java/src/TasksFrame.java @@ -988,6 +988,14 @@ public class TasksFrame extends JFrame { return x; } + public int bin2(int a, int b) + { + int x = 0; + x = a*a - 2*a*b + b*b; + return x; + } + + private void setupBinF() { JPanel jPanel = setupPanel("Binomisches Formel"); diff --git a/src/test/java/src/TasksFrameTest.java b/src/test/java/src/TasksFrameTest.java index 481b32b..27503d7 100644 --- a/src/test/java/src/TasksFrameTest.java +++ b/src/test/java/src/TasksFrameTest.java @@ -16,6 +16,17 @@ class TasksFrameTest { assertEquals(100,x2); } + @Test + void bin2() + { + TasksFrame tasksFrame = new TasksFrame(); + int x = tasksFrame.bin2(5,4); + assertEquals(1, x); + int x2 = tasksFrame.bin2(7,3); + assertEquals(16,x2); + } + + @Test void setupPI() { TasksFrame tasksFrame = new TasksFrame();