-
Notifications
You must be signed in to change notification settings - Fork 94
Expand file tree
/
Copy pathCheckIt.java
More file actions
33 lines (29 loc) · 744 Bytes
/
CheckIt.java
File metadata and controls
33 lines (29 loc) · 744 Bytes
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
26
27
28
29
30
31
32
33
public class CheckIt
{
public static void checkIt (boolean a, boolean b, boolean c)
{
if (a || (b && c))
{
System.out.println ("P is true");
}
else
{
System.out.println ("P isn't true");
}
}
public static void main (String []argv)
{ // Driver method for checkIt
// Read an array from standard input, call checkIt()
boolean []inArr = new boolean [argv.length];
if (argv.length != 3)
{
System.out.println ("Usage: java checkIt v1 v2 v3");
return;
}
for (int i = 0; i< argv.length; i++)
{
inArr [i] = Boolean.parseBoolean(argv[i]);
}
checkIt (inArr[0], inArr[1], inArr[2]);
}
}