master
tmn 4 years ago
commit 2751ab49d3

@ -0,0 +1,26 @@
package com.company;
public class AnalogUhr {
public static int computeHourHandAngle(int hour, int minute){
int StundeWinkel = (60*hour+minute)/2;
return StundeWinkel;
}
public static int computeMinuteHandAngle(int min){
int MinWinkel = 6*min;
return MinWinkel;
}
public static void main(String[] args){
int Stunde = 3;
int Minute = 33;
System.out.println("Winkel für den Stundenzeeiger: "+computeHourHandAngle(Stunde, Minute)+" Grad, Winkel für den Minutenzeiger: "+computeMinuteHandAngle(Minute)+" Grad");
}
}

@ -0,0 +1,40 @@
package com.company;
import java.util.Scanner;
public class EinkaufswagenNummer {
public static void main(String[] args){
Scanner scanner = new Scanner(System.in);
String wagenNummer = scanner.next();
while (wagenNummer.length() == 4 ){
if(wagenNummer.length() == 4){
prüfungNummer();
ausgabe();
}
else{
System.out.println("Nummer zu kurz. Bitte erneut eingeben");
wagenNummer = scanner.next();
}
}
}
public static int prüfungNummer(){
int test = 1;
return(test);
}
public static String ausgabe(){
String test2 = "test";
return(test2);
}
}

@ -0,0 +1,50 @@
package com.company;
public class Main {
public static void main(String[] args) {
int[] prime=new int[6];
prime[0]=2;
prime[1]=3;
prime[2]=5;
prime[3]=7;
prime[4]=11;
prime[5]=13;
for (int x : prime)
System.out.println(x+" ");
double[] squares=new double[10];
for (int i=0; i<10; i++)
{
squares[i]=i*i;
System.out.println("Das Quadrat von "+i+" ist "+squares[i]);
}
double[] squaresCopy=new double[10];
squaresCopy=squares.clone();
for (int i=0; i<10; i++) {
squaresCopy[i] = 0.5;
System.out.println(squaresCopy[i]);
System.out.println(squares[i]);
}
}
}

@ -0,0 +1,37 @@
package com.company;
public class Rotieren {
public static void main(String[] args) {
boolean[][] rotate = {
{true, false, false},
{false, true, false},
{false, false, true},
{false, false, false}
};
boolean[][] ausgabe = negativeRotation(rotate);
for (int i = 0; i < ausgabe.length; i++) {
for (int j = 0; j < ausgabe[0].length; j++) {
System.out.print(ausgabe[i][j] + " ");
}
System.out.println();
}
}
public static boolean[][] negativeRotation(boolean[][] rotating) {
boolean[][] arrayCopy;
arrayCopy = new boolean[rotating[0].length][rotating.length];
for (int i = 0; i < arrayCopy.length; i++) {
for (int j = 0; j < arrayCopy[0].length; j++) {
arrayCopy[i][j] = rotating[j][rotating[j].length - i - 1];
}
}
return arrayCopy;
}
}

@ -0,0 +1,25 @@
package com.company;
public class addierenZwierGanzzahlen {
public static int addieren(int a, int b){
return a + b;
}
public static void main(String[] args){
int number1 = 5;
int number2 = 30;
int add = addieren(number1, number2);
System.out.println(add);
}
}
Loading…
Cancel
Save