fixed the ims-java

This commit is contained in:
Sage The DM 2024-06-24 08:22:15 +02:00
parent b2cded4072
commit 9d8b690096
15 changed files with 236 additions and 1 deletions

@ -1 +0,0 @@
Subproject commit d3092e64bf931d5b98fa000fca03fa1069647646

View file

@ -0,0 +1,8 @@
{
"java.project.sourcePaths": ["src"],
"java.project.outputPath": "bin",
"java.project.referencedLibraries": [
"lib/**/*.jar"
],
"java.format.settings.url": "eclipse-formatter.xml"
}

View file

@ -0,0 +1,18 @@
## Getting Started
Welcome to the VS Code Java world. Here is a guideline to help you get started to write Java code in Visual Studio Code.
## Folder Structure
The workspace contains two folders by default, where:
- `src`: the folder to maintain sources
- `lib`: the folder to maintain dependencies
Meanwhile, the compiled output files will be generated in the `bin` folder by default.
> If you want to customize the folder structure, open `.vscode/settings.json` and update the related settings there.
## Dependency Management
The `JAVA PROJECTS` view allows you to manage your dependencies. More details can be found [here](https://github.com/microsoft/vscode-java-dependency#manage-dependencies).

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View file

@ -0,0 +1,46 @@
package Archiv;
import javax.swing.JOptionPane;
public class Gaptext {
public static void main(String[] args) {
// Lückentexte / kombination aus variablen, print und if/else
// Popups mit User Input
String a = JOptionPane.showInputDialog("Please enter a verb (-ing):");
String b = JOptionPane.showInputDialog("Please enter a location:");
String c = JOptionPane.showInputDialog("Please enter a color:");
String d = JOptionPane.showInputDialog("Please enter something that's that color:");
String e = JOptionPane.showInputDialog("Please enter a diffrent color:");
String f = JOptionPane.showInputDialog("Please enter something that's that color:");
String g = JOptionPane.showInputDialog("Please enter an adjective:");
String h = JOptionPane.showInputDialog("Please enter an object");
// Error message
if (a == null || a.trim().isEmpty()) {
System.out.println("Missing word(s) or canceled.");
} else if (b == null || b.trim().isEmpty()) {
System.out.println("Missing word(s) or canceled.");
} else if (c == null || c.trim().isEmpty()) {
System.out.println("Missing word(s) or canceled.");
} else if (d == null || d.trim().isEmpty()) {
System.out.println("Missing word(s) or canceled.");
} else if (e == null || e.trim().isEmpty()) {
System.out.println("Missing word(s) or canceled.");
} else if (f == null || f.trim().isEmpty()) {
System.out.println("Missing word(s) or canceled.");
} else if (g == null || g.trim().isEmpty()) {
System.out.println("Missing word(s) or canceled.");
} else if (h == null || h.trim().isEmpty()) {
System.out.println("Missing word(s) or canceled.");
} else {
// Lückentext mit variablen
System.out.println("They where " + a + " throw (a) " + b + ". They're eyes where ");
System.out.println(c + " as (the) " + d + " They're hair as " + e + " as (the) " + f + ".");
System.out.println("It was a " + g + " day, after a long journey they finally found their " + h);
}
}
}

View file

@ -0,0 +1,33 @@
package Archiv;
import java.util.Random;
public class Sort {
public static void main(String[] args) throws Exception {
// Creating a Random object
Random random = new Random();
// Define the range for variables
int minRange = -10000;
int maxRange = 10000;
// Generate random values
int a = random.nextInt(maxRange - minRange + 1) + minRange;
int b = random.nextInt(maxRange - minRange + 1) + minRange;
int c = random.nextInt(maxRange - minRange + 1) + minRange;
System.out.println("a equals:" + a);
System.out.println("b equals:" + b);
System.out.println("c equals:" + c);
if (a > b && a > c) {
System.out.println("The largest variable is: a");
} else if (b > a && b > c) {
System.out.println("The largest variable is: b");
} else if (c > a && c > b) {
System.out.println("The largest variable is: c");
} else
System.out.println("All variables have the same value");
}
}

View file

@ -0,0 +1,32 @@
package Archiv;
import java.util.Random;
public class Yoda {
public static void main(String[] args) {
// Print text
System.out.println("A code request you have made,");
System.out.println("Fear not, for I am here to aid.");
System.out.println("In Java, a language so grand,");
System.out.println("I'll lend you a helping hand.");
// Creating a Random object
Random random = new Random();
// Define the range for xx, yy and zz
int minRange = -10000;
int maxRange = 10000;
// Generate random values for xx, zz and yy within the specified range
int xx = random.nextInt(maxRange - minRange + 1) + minRange;
int yy = random.nextInt(maxRange - minRange + 1) + minRange;
int zz = random.nextInt(maxRange - minRange + 1) + minRange;
int sum = xx + yy + zz;
System.out.println("The sum of " + xx + ", " + yy + " and " + zz + " is: " + sum);
System.out.println("May the code be with you!");
}
}

View file

@ -0,0 +1,33 @@
package Archiv;
public class exchange {
public static void main(String[] args) {
int x = 5;
int y = 7;
// Vor dem Tausch
System.out.println(x);
System.out.println(y);
// Tausch
int z = 0;
z = x;
x = y;
y = z;
// Nach dem Tausch
System.out.println(x);
System.out.println(y);
/*
* Tauschen Sie die Inhalte der beiden Variablen! D. h.: Wenn vor dem
* Tausch x den Wert 5 hatte und y den Wert 7, dann soll x nach dem
* Tausch den Wert 7 haben und y den Wert 5. Führen Sie den Tausch
* so durch, dass der Tausch funktioniert, egal mit welchen Werten x
* und y initialisiert wurden.
* Sie dürfen nur Code zwischen den beiden Kommentaren //Tausch
* und //Nach dem Tausch hinzufügen!
*/
}
}

View file

@ -0,0 +1,61 @@
public class Grundlagen {
public static void main(String[] args) {
// Hello World
System.out.println("Hello World");
// Zahlen Variablen
int x = 99;
int y = 2;
x = x + 1;
x = x + y;
System.out.println(x);
// Buchstaben Variablen
char myA = 'a';
System.out.println(myA);
// If & else
if (x > 101) {
System.out.println("Der Wert ist grösser als 101");
} else {
System.out.println("Der Wert ist kleiner als 101");
}
// Iteration
int anzahlDurchgaenge = 1;
while (anzahlDurchgaenge <= 5) {
System.out.println("Durchgang nr. " + anzahlDurchgaenge);
anzahlDurchgaenge += 1;
}
// Datentypen
byte myByte = 127;
short myShort = 300;
// With float the f is necassary because java otherwise treats it as a double
// (simplified anwser)
double myDoubleValue = 34.568956;
float myFloatValue = 17.567f;
// Constant always uppercase // Fixed Number
final double PI = 3.141592876;
int xx = 0;
long yy = 2;
xx++; // inkrement
xx--; // dekrement
xx += (int) y; // Making y (long) a int for calculation
xx += 1; // Short for x = x +1
yy += 4; // Short for y = y +4
yy %= 3; // short for y = y%3 %=Modulo (Ganzahliges Geteiltdurch)
// Square root
double d1 = Math.sqrt(10);
System.out.println(d1 + "noch etwas schreiben" + d1);
}
}

View file

@ -0,0 +1,5 @@
public class Testcode {
public static void main(String[] args) {
}
}