Browse Source

Function Mod

remotes/origin/develop
fdai7460 2 years ago
parent
commit
feb77f111d
  1. 6
      src/main/java/src/TasksFrame.java
  2. 12
      src/test/java/src/TasksFrameTest.java

6
src/main/java/src/TasksFrame.java

@ -79,6 +79,12 @@ public class TasksFrame extends JFrame {
} }
public int calcMod(int n, int x)
{
int rest = n % x;
return rest;
}
private void setupEulerschePhiFunk() { private void setupEulerschePhiFunk() {
JPanel jPanel = setupPanel("Eulersche Phi Funktion"); JPanel jPanel = setupPanel("Eulersche Phi Funktion");

12
src/test/java/src/TasksFrameTest.java

@ -91,6 +91,18 @@ class TasksFrameTest {
} }
@Test
void setupMod()
{
TasksFrame tasksFrame = new TasksFrame();
int p1= tasksFrame.calcMod(5,3);
assertEquals(2,p1);
int p2 = tasksFrame.calcMod(4,2);
assertEquals(0,p2);
int p3= tasksFrame.calcMod(10,3);
assertEquals(1,p3);
}
} }

Loading…
Cancel
Save