Commit af84c69e authored by Georgius's avatar Georgius
Browse files

Ordner mit Datei zum testen hinzugefuegt.

parent af63fdcb
Pipeline #10391 passed with stage
in 1 minute and 57 seconds
!SESSION 2024-11-24 19:29:34.785 -----------------------------------------------
eclipse.buildId=4.33.0.20240905-0613
java.version=23
java.vendor=Eclipse Adoptium
BootLoader constants: OS=macosx, ARCH=aarch64, WS=cocoa, NL=de_DE
Framework arguments: -product org.eclipse.epp.package.java.product -keyring /Users/jessica/.eclipse_keyring
Command-line arguments: -os macosx -ws cocoa -arch aarch64 -product org.eclipse.epp.package.java.product -keyring /Users/jessica/.eclipse_keyring
!ENTRY ch.qos.logback.classic 1 0 2024-11-24 19:29:35.853
!MESSAGE Activated before the state location was initialized. Retry after the state location is initialized.
!ENTRY ch.qos.logback.classic 1 0 2024-11-24 19:30:06.041
!MESSAGE Logback config file: /Users/jessica/Documents/UDigiT-Doctor2dev_cpp_code_conversion/test/.metadata/.plugins/org.eclipse.m2e.logback/logback.2.6.1.20240411-1122.xml
eclipse.preferences.version=1
org.eclipse.jdt.core.compiler.codegen.targetPlatform=22
org.eclipse.jdt.core.compiler.compliance=22
org.eclipse.jdt.core.compiler.problem.enablePreviewFeatures=disabled
org.eclipse.jdt.core.compiler.problem.reportPreviewFeatures=warning
org.eclipse.jdt.core.compiler.release=enabled
org.eclipse.jdt.core.compiler.source=22
package test;
import java.util.Scanner;
public class test {
public static void main(String[] args) {
Scanner scanner = new Scanner(System.in);
System.out.println("Gib die erste Zahl ein:");
double zahl1 = scanner.nextDouble();
System.out.println("Gib die zweite Zahl ein:");
double zahl2 = scanner.nextDouble();
System.out.println("Wähle eine Operation (+, -, *, /):");
char operator = scanner.next().charAt(0);
double ergebnis;
switch (operator) {
case '+':
ergebnis = zahl1 + zahl2;
break;
case '-':
ergebnis = zahl1 - zahl2;
break;
case '*':
ergebnis = zahl1 * zahl2;
break;
case '/':
if (zahl2 != 0) {
ergebnis = zahl1 / zahl2;
} else {
System.out.println("Division durch Null ist nicht erlaubt.");
return;
}
break;
default:
System.out.println("Ungültiger Operator.");
return;
}
System.out.println("Das Ergebnis ist: " + ergebnis);
}
}
package test;
import java.util.Scanner;
public class test {
public static void main(String[] args) {
Scanner scanner = new Scanner(System.in);
System.out.println("Gib die erste Zahl ein:");
double zahl1 = scanner.nextDouble();
System.out.println("Gib die zweite Zahl ein:");
double zahl2 = scanner.nextDouble();
System.out.println("Wähle eine Operation (+, -, *, /):");
char operator = scanner.next().charAt(0);
double ergebnis;
switch (operator) {
case '+':
ergebnis = zahl1 + zahl2;
break;
case '-':
ergebnis = zahl1 - zahl2;
break;
case '*':
ergebnis = zahl1 * zahl2;
break;
case '/':
if (zahl2 != 0) {
ergebnis = zahl1 / zahl2;
} else {
System.out.println("Division durch Null ist nicht erlaubt.");
return;
}
break;
default:
System.out.println("Ungültiger Operator.");
return;
}
System.out.println("Das Ergebnis ist: " + ergebnis);
scanner.close();
}
}
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment