Skip to content
Snippets Groups Projects
Commit 52dccbba authored by matthias's avatar matthias
Browse files

Wahrheitstabelle aus Lösung

parent b4ae4491
No related branches found
No related tags found
No related merge requests found
package wahrheitstabelle;
public class Wahrheitstabelle {
public static void main(String[] args) {
boolean a = false;
boolean b = false;
boolean c = true;
boolean f = (a && b) || (a && !c);
System.out.println("F = (A && B) || (A && !C)");
System.out.println();
System.out.println("-----------------------------");
System.out.println("| A | B | C | F |");
System.out.println("-----------------------------");
// boolean ergebnis1 = a && b;
// boolean ergebnis2 = a && !c;
//
// System.out.println();
// System.out.println("|"+ a + " "+ "|"+ b + " "+ "|"+ ergebnis1 + " "+ "| "+ f + " |");
boolean A;
boolean B;
boolean C;
boolean F;
System.out.println("\nF = (A && B) || (A && !C)\n");
System.out.println("---------------------------------");
System.out.println("| A\t| B\t| C\t| F\t|");
System.out.println("---------------------------------");
for (int a = 0; a <= 1; a++) {
for (int b = 0; b <= 1; b++) {
for (int c = 0; c <= 1; c++) {
A = (a == 1);
B = (b == 1);
C = (c == 1);
F = (A && B) || (A && !C);
System.out.println("|" + A + "\t|" + B + "\t|" + C + "\t| " + F + "\t|");
}
}
}
System.out.println("---------------------------------");
}
}
}
\ No newline at end of file
package zahlenreihe;
public class Zahlenreihe {
public static void main(String[] args) {
int f1;
int f2;
int f3;
for(f1 = 10; f1 <=20; f1 = f1 +2) {
System.out.print(f1 + " ");
}
System.out.println();
for(f2 = 50; f2 <=100; f2 = f2 +10) {
System.out.print(f2 + " ");
}
System.out.println();
for(f3 = 99; f3 >= 94; f3 = f3 -1) {
System.out.print(f3 + " ");
}
}
}
......@@ -3,7 +3,10 @@ package fakultaet;
public class Fakultaet {
public static void main(String[] args) {
// TODO Auto-generated method stub
int a = 10;
System.out.println("a = " + a);
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment