Test
commit
97adc760ad
|
@ -0,0 +1,10 @@
|
|||
<?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-17">
|
||||
<attributes>
|
||||
<attribute name="module" value="true"/>
|
||||
</attributes>
|
||||
</classpathentry>
|
||||
<classpathentry kind="src" path="src"/>
|
||||
<classpathentry kind="output" path="bin"/>
|
||||
</classpath>
|
|
@ -0,0 +1 @@
|
|||
/bin/
|
|
@ -0,0 +1,17 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<projectDescription>
|
||||
<name>Programmieren</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>
|
|
@ -0,0 +1,2 @@
|
|||
eclipse.preferences.version=1
|
||||
encoding/<project>=UTF-8
|
|
@ -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
|
|
@ -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; }
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -0,0 +1,9 @@
|
|||
/**
|
||||
*
|
||||
*/
|
||||
/**
|
||||
* @author petar
|
||||
*
|
||||
*/
|
||||
module Programmieren {
|
||||
}
|
|
@ -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));
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue