|
|
@ -68,8 +68,28 @@ public class TasksFrame extends JFrame { |
|
|
|
|
|
|
|
setup5ModList(1, 20); |
|
|
|
|
|
|
|
setupLeibnizR(1000); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
public double setupLeibnizR(int t) { |
|
|
|
double sum=0; |
|
|
|
for(int i=0;i<t;i++){ |
|
|
|
sum += Math.pow(-1,i)/((2*i)+1); |
|
|
|
} |
|
|
|
JPanel jPanel = setupPanel("Leibniz F. von 0 bis" + t); |
|
|
|
|
|
|
|
JLabel summe = new JLabel(); |
|
|
|
summe.setVisible(true); |
|
|
|
summe.setText(String.valueOf(sum)); |
|
|
|
summe.setBounds(10,50,100,30); |
|
|
|
|
|
|
|
jPanel.add(summe); |
|
|
|
|
|
|
|
return sum; |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
private ArrayList<Integer> setup5ModList(int from, int to) { |
|
|
|
|
|
|
|
ArrayList<Integer> mods = new ArrayList<>(); |
|
|
|