commit 4a717da125cfb9dc2f08b1ea49a9124c27c92dcd Author: name <@> Date: Fri Mar 31 05:21:44 2023 -0700 Initial sharing of project diff --git a/._package.bluej b/._package.bluej new file mode 100755 index 0000000..b564b38 Binary files /dev/null and b/._package.bluej differ diff --git a/Eingabe.java b/Eingabe.java new file mode 100755 index 0000000..b38f078 --- /dev/null +++ b/Eingabe.java @@ -0,0 +1,45 @@ + +/** + * Beschreiben Sie hier die Klasse Eingabe. + * + * @author (Ihr Name) + * @version (eine Versionsnummer oder ein Datum) + */ + +import java.util.Scanner; +public class Eingabe +{ + public static void rechner() +{ + Scanner sc = new Scanner(System.in); + System.out.println("Erste Zahl eingeben:" ); + int eingabe = sc.nextInt(); + System.out.println("Zweite zahl eingeben:" ); + int eingabe2 = sc.nextInt(); + int differenz = eingabe - eingabe2; + int produkt = eingabe * eingabe2; + int quotient = eingabe / eingabe2; + int rest = eingabe % eingabe2; + int summe = eingabe + eingabe2; + + System.out.println("Summe:" + summe); + + System.out.println("Differenz:" + differenz); + + System.out.println("Produkt:" + produkt); + + System.out.println( "Quotient:" + quotient); + + System.out.println("Rest:" + rest); + + + + + + +} + + + + +} diff --git a/HelloWorld.java b/HelloWorld.java new file mode 100755 index 0000000..2be0af1 --- /dev/null +++ b/HelloWorld.java @@ -0,0 +1,16 @@ + +/** + * Beschreiben Sie hier die Klasse HelloWorld. + * + * @author (Ihr Name) + * @version (eine Versionsnummer oder ein Datum) + */ + +public class HelloWorld +{ + public static void helloWorld() + { + System.out.println("Hallo"); + } + +} diff --git a/Methoden.java b/Methoden.java new file mode 100755 index 0000000..1a7afa2 --- /dev/null +++ b/Methoden.java @@ -0,0 +1,164 @@ + +/** + * Beschreiben Sie hier die Klasse Methoden. + * + * @author (Ihr Name) + * @version (eine Versionsnummer oder ein Datum) + */ +public class Methoden +{ + public static float quadrat(float x) + { + float quadrat = x*x; + return quadrat; + } + public static void test() + { + float a = quadrat(5); + System.out.println("Das Quadrat von 5 ist" + a); + } + public static int summe(int a,int b) + { + int summe = a+b; + System.out.println(summe); + return summe; + + } + public static int differenz( int a,int b) + {int differenz = a-b; + System.out.println(differenz); + return differenz; + + } + public static int produkt( int a,int b) + {int produkt = a*b; + System.out.println(produkt); + return produkt; + + } + public static int quotient( int a,int b) + {int quotient = a/b; + System.out.println(quotient); + return quotient; + + } + public static int term() + { return produkt(3, summe(2,5)); + } + public static double potenz(double a,int b) + { + + /** + * Berechnet die Potenz a hoch b + */ + double zwischenergebnis = 1; + for(int i = 0;i0) + { + return a; + } + else + { + return -a; + } + } + public static int round(double zahl) + { + int vorkomma = (int) zahl; + double nachkomma = zahl - vorkomma; + + if(nachkomma<0.5) + { + return vorkomma; + } + else + { + return vorkomma + 1; + + + } + } + public static boolean istGross(int a) + { + if(a<1000) + { + return false; + } + else + { + return true; + } + } + public static boolean istmaesigGross(int a) + { + int betrag = abs(a); + if(betrag>1000 ) + {return true; + } + else + {return false; + } + } + public static boolean istGerade(int a) + { + if(a % 2 == 0) + { + return true; + } + else + { + return false; + } + } + public static boolean istTeilbar(int a,int b) + { + if(a % b == 0) + { + return true; + } + else + { + return false; + } + } + public static boolean istPrim(int a) + { + for(int i=2;i< a/2;i++) + { + if(a % i == 0) + { + return false; + } + } + return true; + } +} \ No newline at end of file diff --git a/Mitternachtsformel.java b/Mitternachtsformel.java new file mode 100755 index 0000000..d387813 --- /dev/null +++ b/Mitternachtsformel.java @@ -0,0 +1,45 @@ + +/** + * Beschreiben Sie hier die Klasse Mitternachtsformel. + * + * @author (Ihr Name) + * @version (eine Versionsnummer oder ein Datum) + */ +import java.util.Scanner; +public class Mitternachtsformel +{ + + + + + public static void mitternachtsformel() + { + Scanner sc = new Scanner(System.in); + System.out.println("Mitternachtsformelrechner"); + System.out.println("Berechnet die Lösungen einer quadratischen Gleichung"); + System.out.println("ax^2 + bx + c = 0"); + System.out.println("Bitte jetzt Parameter eingeben"); + System.out.print("a = "); + double a = sc.nextDouble(); + System.out.print("b = "); + double b = sc.nextDouble(); + System.out.print("c = "); + double c = sc.nextDouble(); + double d = Math.sqrt(b * b - 4 * a * c); + + if (d!=0) + System.out.println("Fehler weil Diskriminante kleiner 0"); + double x1 = -b + Math.sqrt(b * b - 4 * a * c )/ (2 * a); + double x2 = -b - Math.sqrt(b * b - 4 * a * c)/ (2 * a); + System.out.println(" Die Lösungen der quadratischen Gleichung " + a+ "x^2+"+ b+"x +" + c + "= 0 sind:"); + System.out.println("x1=" + x1 + "und" + " x2=" +x2); + + } + + + + + + + +} diff --git a/README.TXT b/README.TXT new file mode 100755 index 0000000..0ad193f --- /dev/null +++ b/README.TXT @@ -0,0 +1,14 @@ +------------------------------------------------------------------------ +Dies ist die README-Datei des Projekts. Hier sollten Sie Ihr Projekt +beschreiben. +Erzählen Sie dem Leser (jemand, der nichts über dieses Projekt weiss), +alles, was er/sie wissen muss. Üblicherweise sollte der Kommentar +zumindest die folgenden Angaben umfassen: +------------------------------------------------------------------------ + +PROJEKTBEZEICHNUNG: +PROJEKTZWECK: +VERSION oder DATUM: +WIE IST DAS PROJEKT ZU STARTEN: +AUTOR(EN): +BENUTZERHINWEISE: diff --git a/Schleifen.java b/Schleifen.java new file mode 100755 index 0000000..c458a0b --- /dev/null +++ b/Schleifen.java @@ -0,0 +1,24 @@ + +/** + * Beschreiben Sie hier die Klasse Schleifen. + * + * @author (Ihr Name) + * @version (eine Versionsnummer oder ein Datum) + */ +public class Schleifen +{ + public static void Schleifen() + { + float i = 0; + while ( i*i<500) + { + System.out.println(Methoden.quadrat(i)); + i++; + } +} + public static void zahlenRaten() +{ + int zufallszahl = (int) (Math.random()*10+1); + +} +} \ No newline at end of file diff --git a/package.bluej b/package.bluej new file mode 100755 index 0000000..9bbe3eb --- /dev/null +++ b/package.bluej @@ -0,0 +1,60 @@ +#BlueJ package file +editor.fx.0.height=0 +editor.fx.0.width=0 +editor.fx.0.x=0 +editor.fx.0.y=0 +objectbench.height=163 +objectbench.width=776 +package.divider.horizontal=0.6 +package.divider.vertical=0.6730769230769231 +package.editor.height=343 +package.editor.width=661 +package.editor.x=0 +package.editor.y=25 +package.frame.height=584 +package.frame.width=800 +package.numDependencies=0 +package.numTargets=5 +package.showExtends=true +package.showUses=true +project.charset=UTF-8 +readme.height=60 +readme.name=@README +readme.width=48 +readme.x=10 +readme.y=10 +target1.height=70 +target1.name=Methoden +target1.showInterface=false +target1.type=ClassTarget +target1.width=120 +target1.x=140 +target1.y=170 +target2.height=70 +target2.name=Mitternachtsformel +target2.showInterface=false +target2.type=ClassTarget +target2.width=150 +target2.x=10 +target2.y=90 +target3.height=70 +target3.name=Eingabe +target3.showInterface=false +target3.type=ClassTarget +target3.width=120 +target3.x=220 +target3.y=10 +target4.height=70 +target4.name=HelloWorld +target4.showInterface=false +target4.type=ClassTarget +target4.width=120 +target4.x=60 +target4.y=10 +target5.height=70 +target5.name=Schleifen +target5.showInterface=false +target5.type=ClassTarget +target5.width=120 +target5.x=10 +target5.y=170