-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathnegation.java
25 lines (23 loc) · 859 Bytes
/
negation.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
import lib.classes;
public class negation {
public static void main(String[] args) {
java.util.Scanner input = new java.util.Scanner(System.in);
int count;
try {
System.out.print("how long you want to insert?(1/88) \n >>");
count = input.nextInt();
boolean[] a = new boolean[count];
for (int i=0; i<count; i++) {
System.out.print("enter true/false for "+ (i+1) + "a: ");
a[i] = input.nextBoolean();
}
input.close();
for (int i=0; i<a.length; i++) {
System.out.println("formula: (!"+a[i]+") " + " the " + (i+1)+ "a" + " Is: " + classes.negation(a[i]));
}
} catch (java.util.InputMismatchException e) {
input.close();
classes.BadUser();
}
}
}