diff --git a/PiBerechnen b/PiBerechnen index 83b5222..a0302a6 100644 --- a/PiBerechnen +++ b/PiBerechnen @@ -1,10 +1,7 @@ using System; - namespace B_GOP01XX_AG_1 { - - // Aufgabenschritt 1 - Klassendefinition class WallisschesProdukt { @@ -15,13 +12,9 @@ namespace B_GOP01XX_AG_1 for(double i = 1; i < Convert.ToDouble(n); i++, step++) { - if (i % 2 == 0){ - halfPI *= (step / (step+1)); - } - else { - halfPI *= ((step+1) / step); - } + if(i%2 == 0) halfPI *= (step / (step+1)); else halfPI *= ((step+1) / step); } + return halfPI * 2.0; } } @@ -38,7 +31,6 @@ namespace B_GOP01XX_AG_1 static int tableWidth = 77; - public void PrintLine() { Console.WriteLine(new string('-', tableWidth)); @@ -57,7 +49,6 @@ namespace B_GOP01XX_AG_1 Helper testNow = new Helper(); testNow.adjustBuffer(); - Console.WriteLine(String.Format("{0, 0}{1,-5}{2, 0}{3, 0}","Faktor:","","","Walissches Produkt:")); for (int i = 1; i <= 1000; i++) {