Skip to content
Snippets Groups Projects
Commit e8904131 authored by matthias's avatar matthias
Browse files

migration

parents
No related branches found
No related tags found
No related merge requests found
Showing
with 394 additions and 0 deletions
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER">
<attributes>
<attribute name="module" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="src" path="src"/>
<classpathentry kind="output" path="bin"/>
</classpath>
/bin/
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>zahlenreihe</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>org.eclipse.jdt.core.javabuilder</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>org.eclipse.jdt.core.javanature</nature>
</natures>
</projectDescription>
package zahlenreihe;
public class Zahlenreihe {
public static void main(String[] args) {
int f1;
int f2;
int f3;
for(f1 = 10; f1 <=20; f1 = f1 +2) {
System.out.print(f1 + " ");
}
System.out.println();
for(f2 = 50; f2 <=100; f2 = f2 +10) {
System.out.print(f2 + " ");
}
System.out.println();
for(f3 = 99; f3 >= 94; f3 = f3 -1) {
System.out.print(f3 + " ");
}
}
}
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
<classpathentry kind="src" path="src"/>
<classpathentry kind="output" path="bin"/>
</classpath>
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>Übungsblatt 1</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>org.eclipse.jdt.core.javabuilder</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>org.eclipse.jdt.core.javanature</nature>
</natures>
</projectDescription>
/benzinrechner/
/hallowelt/
/quadrat/
/rechnen/
package benzinrechner;
import java.util.Scanner;
public class Benzinrechner {
public static void main(String[] args){
Scanner input1 = new Scanner(System.in);
final float VERBRAUCH = 8.0f;
float ergebnis;
System.out.print("Geben Sie die gefahrenen Kilometer ein: " );
float inputKilometer = input1.nextInt();
input1.close();
ergebnis = (inputKilometer / 100) * VERBRAUCH;
System.out.println("Ihr Auto hat auf " +inputKilometer +" Kilometer " + ergebnis +" Liter Benzin verbraucht." );
}
}
package hallowelt;
public class Name {
public static void main(String[] args) {
//* Ausgabe eines Textes
String s1 = "Matthias Hoffmann";
String s2 = " - ";
String s3 = s1 + s2 + s1 + s2 + s1;
System.out.println(s3 +"\n" + s3 +"\n" +s3);
}
}
package quadrat;
import java.util.Scanner;
public class Quadrat {
public static void main(String[] args) {
Scanner input = new Scanner(System.in);
double flaeche, seitenlaenge;
System.out.print("Seitenlänge des Quadrats: ");
seitenlaenge = input.nextInt();
flaeche = seitenlaenge * seitenlaenge;
System.out.println("Fläche des Quadrats: " + flaeche);
System.out.println("Diagonale des Quadrats: " + (seitenlaenge * Math.sqrt(2)));
input.close();
}
}
package rechnen;
public class Rechnen {
public static void main(String[] args) {
String s1 = "5 * 2 = ";
String s2 = "5 + 2 = ";
String s3 = "5 / 2 = ";
System.out.println(s1 + (5*2));
System.out.println(s2 + (5+2));
System.out.println(s3 + (5.0*2));
}
}
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-12">
<attributes>
<attribute name="module" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="src" path="src"/>
<classpathentry kind="output" path="bin"/>
</classpath>
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>Übungsblatt 2</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>org.eclipse.jdt.core.javabuilder</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>org.eclipse.jdt.core.javanature</nature>
</natures>
</projectDescription>
eclipse.preferences.version=1
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
org.eclipse.jdt.core.compiler.codegen.targetPlatform=12
org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
org.eclipse.jdt.core.compiler.compliance=12
org.eclipse.jdt.core.compiler.debug.lineNumber=generate
org.eclipse.jdt.core.compiler.debug.localVariable=generate
org.eclipse.jdt.core.compiler.debug.sourceFile=generate
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
org.eclipse.jdt.core.compiler.problem.enablePreviewFeatures=disabled
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
org.eclipse.jdt.core.compiler.problem.reportPreviewFeatures=warning
org.eclipse.jdt.core.compiler.release=enabled
org.eclipse.jdt.core.compiler.source=12
/logik/
/maximum/
/minimum/
/woche/
package logik;
public class Logik {
public static void main(String[] args) {
boolean a = true;
boolean b = false;
boolean c = true;
boolean ergebnis1 = a && b && (c || !a);
boolean ergebnis2 = a || !b && c;
boolean ergebnis3 = !a || !b || c;
boolean ergebnis4 = a && b && c;
System.out.println("a = " + a);
System.out.println("b = " + b);
System.out.println("c = " + c + "\n");
System.out.println("a && b && (c || !a) = " +ergebnis1);
System.out.println("a || !b && c = " +ergebnis2);
System.out.println("!a || !b || c = " +ergebnis3 + "\n");
System.out.println("a && b && c = " +ergebnis4);
}
}
package maximum;
public class Maximum {
public static void main(String[] args) {
int x = 100;
int y = 200;
int z = -20;
int max = 0;
int count = 0;
if (x >= y && x >= z)
{max = x;}
else if (y >= x && y >= z) {
max = y;
}
else{
max = z;
}
System.out.println("(1) Das Maximum ist " + max );
if ( x < 0)
{
count++;
}
if ( y < 0)
{
count++;
}
if ( z < 0)
{
count++;
}
System.out.println("(2) Die Anzahl der negativen Zahlen ist " + count );
}
}
package minimum;
public class Minimum {
public static void main(String[] args) {
int x = 100;
int y = 200;
int z = -20;
int min = (x < y? x : y);
min = (min < z) ? min : z;
// int min1 = x > z? x : z;
// int min2 = y > z? y : z;
// int min3 = min1 > z? min1 : z;
// int min4 = min3 > z? min3 : z;
System.out.println("x ist = " +x);
System.out.println("y ist = " +y);
System.out.println("z ist = " +z);
System.out.println("Das Minimum ist " +min);
}
}
package woche;
public class Woche {
public static void main(String[] args) {
int tag = 8;
boolean wochenende = true;
String wochentag;
String ausgabe;
switch (tag) {
case 1:
wochentag = ("Montag");
wochenende = false;
break;
case 2:
wochentag = ("Dienstag");
wochenende = false;
break;
case 3:
wochentag = ("Mittwoch");
wochenende = false;
break;
case 4:
wochentag = ("Donnerstag");
wochenende = false;
break;
case 5:
wochentag = ("Freitag");
wochenende = false;
break;
case 6:
wochentag = ("Samstag");
wochenende = true;
break;
case 7:
wochentag = ("Sonntag");
wochenende = true;
break;
default:
wochentag = ("Kein gltiger Tag");
}
ausgabe = wochentag;
if(!wochenende) {
System.out.println(ausgabe + " (ein Wochentag!)");
}
else if(tag >= 8 || tag <= 0 ) {
System.out.println(ausgabe);
}
else {
System.out.println(ausgabe + " (Wochenende!)");
}
}
}
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER">
<attributes>
<attribute name="module" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="src" path="src"/>
<classpathentry kind="output" path="bin"/>
</classpath>
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment