diff --git a/src/main/java/src/TasksFrame.java b/src/main/java/src/TasksFrame.java index bf0effa..863e515 100644 --- a/src/main/java/src/TasksFrame.java +++ b/src/main/java/src/TasksFrame.java @@ -247,6 +247,13 @@ public class TasksFrame extends JFrame { return steuer; } + public double steuer7(double x) + { + double steuer=0; + steuer = (x * 0.07) / 1.07; + return steuer; + } + private void setupUmrechnen() { JPanel jPanel = setupPanel("Dezimal nach Binär"); diff --git a/src/test/java/src/TasksFrameTest.java b/src/test/java/src/TasksFrameTest.java index 51e8cc8..1fef532 100644 --- a/src/test/java/src/TasksFrameTest.java +++ b/src/test/java/src/TasksFrameTest.java @@ -49,6 +49,17 @@ class TasksFrameTest { assertEquals(0,x3,0.01); } + @Test + void setupSteuer7(){ + TasksFrame tasksFrame = new TasksFrame(); + double x = tasksFrame.steuer7(1190); + assertEquals(77.85,x, 0.01); + double x2 = tasksFrame.steuer7(14); + assertEquals(0.92,x2,0.01); + double x3 = tasksFrame.steuer7(0); + assertEquals(0,x3,0.01); + } + @Test void setupDiff(){ TasksFrame frame = new TasksFrame();