Ver código fonte

Initial commit

Ritter 2 anos atrás
commit
caed82a4e7
4 arquivos alterados com 53 adições e 0 exclusões
  1. 2 0
      .gitignore
  2. 1 0
      README
  3. 17 0
      src/Calculus.java
  4. 33 0
      src/InputOutput.java

+ 2 - 0
.gitignore

@@ -0,0 +1,2 @@
+*.class
+*.jar

+ 1 - 0
README

@@ -0,0 +1 @@
+Dieses Projekt dient zu Übungszwecken beim Erlernen von Java. Auszuführen ist das Projekt als Java-Application. Inputs, die zu tätigen sind, werden entsprechend in der Konsole vorab beschrieben. Mithilfe dieser Datei muss eine 

+ 17 - 0
src/Calculus.java

@@ -0,0 +1,17 @@
+
+public class Calculus {
+
+	public static void main(String[] args) {
+		// TODO Auto-generated method stub
+		
+		boolean b = true;
+		boolean b2 = false;
+		double d = 10;
+		float f = (float) d/3;
+		double d2 = f;
+		System.out.println(d2);
+		
+	}
+	
+
+}

+ 33 - 0
src/InputOutput.java

@@ -0,0 +1,33 @@
+	import java.util.Scanner;
+	
+	public class InputOutput {
+	
+
+	
+	public static void main(String args[]) {
+		
+		int x = 0; 
+		String text = ""; 
+		Scanner scanner = new Scanner(System.in);
+
+		while ( x < 1 ) { 
+		
+			System.out.println("Bitte gib eine positive Zahl ein: ");
+			text = scanner.nextLine();
+			x = Integer.parseInt(text);
+		
+		}
+		
+		System.out.println("Bitte gib einen Text ein:");
+		text = scanner.nextLine();
+		
+		
+		for (int i = 0; i < x; i++) {
+			System.out.println(text);
+		}
+
+		
+	
+	}
+
+}