commit 97adc760ad888e5194adecf00572514febf24ea7 Author: petar Date: Wed Oct 12 15:04:49 2022 +0200 Test diff --git a/Programmieren/.classpath b/Programmieren/.classpath new file mode 100644 index 0000000..ac9ce57 --- /dev/null +++ b/Programmieren/.classpath @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/Programmieren/.gitignore b/Programmieren/.gitignore new file mode 100644 index 0000000..ae3c172 --- /dev/null +++ b/Programmieren/.gitignore @@ -0,0 +1 @@ +/bin/ diff --git a/Programmieren/.project b/Programmieren/.project new file mode 100644 index 0000000..9720bac --- /dev/null +++ b/Programmieren/.project @@ -0,0 +1,17 @@ + + + Programmieren + + + + + + org.eclipse.jdt.core.javabuilder + + + + + + org.eclipse.jdt.core.javanature + + diff --git a/Programmieren/.settings/org.eclipse.core.resources.prefs b/Programmieren/.settings/org.eclipse.core.resources.prefs new file mode 100644 index 0000000..4824b80 --- /dev/null +++ b/Programmieren/.settings/org.eclipse.core.resources.prefs @@ -0,0 +1,2 @@ +eclipse.preferences.version=1 +encoding/=UTF-8 diff --git a/Programmieren/.settings/org.eclipse.jdt.core.prefs b/Programmieren/.settings/org.eclipse.jdt.core.prefs new file mode 100644 index 0000000..dbc27c5 --- /dev/null +++ b/Programmieren/.settings/org.eclipse.jdt.core.prefs @@ -0,0 +1,14 @@ +eclipse.preferences.version=1 +org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled +org.eclipse.jdt.core.compiler.codegen.targetPlatform=17 +org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve +org.eclipse.jdt.core.compiler.compliance=17 +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=17 diff --git a/Programmieren/src/PR1/mannheimHS.java b/Programmieren/src/PR1/mannheimHS.java new file mode 100644 index 0000000..8d4cd75 --- /dev/null +++ b/Programmieren/src/PR1/mannheimHS.java @@ -0,0 +1,43 @@ +package PR1; + +import java.util.*; +public class mannheimHS { + + public static void main(String[] args) { + + //importing scanner function + Scanner sc = new Scanner(System.in); + //pretext before entering the roman characters + System.out.print("Bitte Römische Zahl eingeben: "); + String in = sc.nextLine(); + int n = 0; + //for-loop to determine how many characters are entered + for(int i=0;i<10;i++) { + //if-function to determine which roman character has been entered + if(in.charAt(i) == 'I') { + System.out.println("1"); + n = n + 1; } + if(in.charAt(i) == 'V') { + System.out.println("5"); + n = n + 5; } + if(in.charAt(i) == 'X') { + System.out.println("10"); + n = n + 10; } + if(in.charAt(i) == 'L') { + System.out.println("50"); + n = n + 50; } + if(in.charAt(i) == 'C') { + System.out.println("100"); + n = n + 100; } + if(in.charAt(i) == 'D') { + System.out.println("500"); + n = n + 500; } + if(in.charAt(i) == 'M') { + System.out.println("1000"); + n = n + 1000; } + + } + } + } + + diff --git a/Programmieren/src/module-info.java b/Programmieren/src/module-info.java new file mode 100644 index 0000000..360c144 --- /dev/null +++ b/Programmieren/src/module-info.java @@ -0,0 +1,9 @@ +/** + * + */ +/** + * @author petar + * + */ +module Programmieren { +} \ No newline at end of file diff --git a/Programmieren/src/Übung/uebung.java b/Programmieren/src/Übung/uebung.java new file mode 100644 index 0000000..2c7be37 --- /dev/null +++ b/Programmieren/src/Übung/uebung.java @@ -0,0 +1,31 @@ +package Übung; + +public class uebung { + + public static void main(String[] args) { + System.out.println("Hello World"); + String name = "Petar"; + int alter = 18; + double groese = 174.5; + System.out.println("Hallo mein Name ist " + name + " und ich bin " + alter + " Jahre alt auserdem bin ich " + groese + " cm gross"); + + double x = 42.1; + double y = Math.floor(x); + System.out.println(y); + double z = Math.ceil(x); + System.out.println(z); + double a = Math.pow(x, 2); + System.out.println(a); + + String majmun = "Affe"; + System.out.println(majmun.toUpperCase()); + System.out.println(majmun.charAt(0)); + + + + + + + + } + }