faecher:informatik:oberstufe:java:algorithmen:uebungen01:loesungsvorschlaege

Unterschiede

Hier werden die Unterschiede zwischen zwei Versionen der Seite angezeigt.

Link zu der Vergleichsansicht

Beide Seiten, vorherige Überarbeitung Vorherige Überarbeitung
Nächste Überarbeitung
Vorherige Überarbeitung
faecher:informatik:oberstufe:java:algorithmen:uebungen01:loesungsvorschlaege [13.09.2021 13:15] – [A0] sbelfaecher:informatik:oberstufe:java:algorithmen:uebungen01:loesungsvorschlaege [18.03.2025 18:38] (aktuell) – [A01] Frank Schiebel
Zeile 8: Zeile 8:
 ++++ Lösungsvorschlag A01| ++++ Lösungsvorschlag A01|
 <code java> <code java>
-public int 01MyModulo(int a, int b)+public int Modulo(int a, int b)
     {     {
         int remainder=0;         int remainder=0;
Zeile 21: Zeile 21:
  
 <code java> <code java>
-public int MyModulo(int a, int b)+public int Modulo(int a, int b)
     {     {
         return a - a/b*b;         return a - a/b*b;
Zeile 276: Zeile 276:
 ++++ ++++
  
-===== A0 =====+===== A13 =====
  
  
-++++ Lösungsvorschlag A0 |+++++ Lösungsvorschlag A13 |
 <code java> <code java>
 + public double a13pi(int n, boolean watch)
 +    {
 +        double pi4=0.0;
 +        double nenner=1.0;
 +        
 +        for (int i=0; i<n; i++) {
 +            if ( i % 2 == 0 ){
 +                pi4 = pi4 + 1.0/nenner; 
 +            } else {
 +                pi4 = pi4 - 1.0/nenner; 
 +            }
 +            nenner = nenner + 2; 
 +            
 +            if (watch) {
 +                System.out.println("Iteration: " + i + "  Näherungswert: " + 4*pi4);
 +            }
 +        }
 +        
 +        return 4*pi4;
 +    }
 +</code>
 +++++
  
 +===== A14 =====
 +
 +
 +++++ Lösungsvorschlag A14 |
 +<code java>
 +public void a14quadrat(int n)
 +    {
 +        for (int i=0; i<n;i++) {
 +            for(int j=0; j<n; j++) {
 +                System.out.print("x ");
 +            }
 +            System.out.println("");
 +        }
 +    }
 +</code>
 +++++
 +
 +===== A15 =====
 +
 +
 +++++ Lösungsvorschlag A15 |
 +<code java>
 +public void a15dreieck(int n)
 +    {
 +        for (int i=0; i<=n;i++) {
 +            for(int j=0; j<i; j++) {
 +                System.out.print("x ");
 +            }
 +            System.out.println("");
 +        }
 +    }
 </code> </code>
 ++++ ++++
  
-===== A0 =====+===== A15 =====
  
  
-++++ Lösungsvorschlag A0 |+++++ Lösungsvorschlag |
 <code java> <code java>
  
 </code> </code>
 ++++ ++++
-===== Lotto =====+===== A16 =====
  
  
-++++ Lösungsvorschlag Lotto |+++++ Lösungsvorschlag A16 |
 <code java> <code java>
-public void a05lottozahlen () {+public void a16lottozahlen () {
                  
         int anzahl = 9;         int anzahl = 9;
  • faecher/informatik/oberstufe/java/algorithmen/uebungen01/loesungsvorschlaege.1631538939.txt.gz
  • Zuletzt geändert: 13.09.2021 13:15
  • von sbel