Browse Source

2-te Binomische Formel Funktion + Test

remotes/origin/develop
fdai7460 2 years ago
parent
commit
00918666dd
  1. 8
      src/main/java/src/TasksFrame.java
  2. 11
      src/test/java/src/TasksFrameTest.java

8
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");

11
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();

Loading…
Cancel
Save