Browse Source

Binomische Formel + Test

remotes/origin/develop
fdai7460 2 years ago
parent
commit
e4fedff499
  1. 14
      src/main/java/src/TasksFrame.java
  2. 13
      src/test/java/src/TasksFrameTest.java

14
src/main/java/src/TasksFrame.java

@ -8,6 +8,8 @@ import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.util.ArrayList;
import java.util.LinkedList;
import java.lang.Character;
public class TasksFrame extends JFrame {
@ -191,8 +193,6 @@ public class TasksFrame extends JFrame {
return Math.round(result * 100.0) / 100.0;
}
private void setupDurchschnitt() {
JPanel jPanel = setupPanel("Durchschnitt");
@ -247,8 +247,6 @@ public class TasksFrame extends JFrame {
}
private void setupExponent() {
JPanel jPanel = setupPanel("Potenzrechner");
@ -391,6 +389,7 @@ public class TasksFrame extends JFrame {
return steuer;
}
private void setupSteuer()
{
JPanel jPanel = setupPanel("Steuer Berechner von Kaufprodukten");
@ -980,6 +979,13 @@ public class TasksFrame extends JFrame {
jPanel.add(k);
}
public int bin1(int a, int b)
{
int x = 0;
x = a*a + 2*a*b + b*b;
return x;
}
public void setupArea()
{

13
src/test/java/src/TasksFrameTest.java

@ -2,10 +2,21 @@ package src;
import org.junit.jupiter.api.Test;
import static org.junit.jupiter.api.Assertions.*;
class TasksFrameTest {
@Test
void bin1() {
TasksFrame tasksFrame = new TasksFrame();
int x = tasksFrame.bin1(5, 4);
assertEquals(81, x);
int x2 = tasksFrame.bin1(7,3);
assertEquals(100,x2);
}
@Test
void setupPI() {
TasksFrame tasksFrame = new TasksFrame();
@ -37,7 +48,7 @@ class TasksFrameTest {
assertEquals(273.15,x3,0.01);
}
@Test
void setupSteuer19(){
TasksFrame tasksFrame = new TasksFrame();

Loading…
Cancel
Save