From a70ed77d06d9ea4537d0edce5b1b3155154c3e24 Mon Sep 17 00:00:00 2001 From: fdai7460 Date: Thu, 9 Feb 2023 19:24:18 +0100 Subject: [PATCH] 3-te Binomische Formel Funktion + Test --- src/main/java/src/TasksFrame.java | 7 +++++++ src/test/java/src/TasksFrameTest.java | 10 ++++++++++ 2 files changed, 17 insertions(+) diff --git a/src/main/java/src/TasksFrame.java b/src/main/java/src/TasksFrame.java index 533e966..b272465 100644 --- a/src/main/java/src/TasksFrame.java +++ b/src/main/java/src/TasksFrame.java @@ -995,6 +995,13 @@ public class TasksFrame extends JFrame { return x; } + public int bin3(int a, int b) + { + int x = 0; + x = a*a - b*b; + return x; + } + private void setupBinF() { diff --git a/src/test/java/src/TasksFrameTest.java b/src/test/java/src/TasksFrameTest.java index 27503d7..c99c3db 100644 --- a/src/test/java/src/TasksFrameTest.java +++ b/src/test/java/src/TasksFrameTest.java @@ -26,6 +26,16 @@ class TasksFrameTest { assertEquals(16,x2); } + @Test + void bin3() + { + TasksFrame tasksFrame = new TasksFrame(); + int x = tasksFrame.bin3(5,4); + assertEquals(9, x); + int x2 = tasksFrame.bin3(7,3); + assertEquals(40,x2); + } + @Test void setupPI() {