Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class NumberTwo
- {
- public static void main(String[] args)
- {
- boolean compProp;
- boolean[] values = {true, false};
- String ans = "false";
- System.out.println("p q r s 1 2 3 4 5");
- for(boolean p : values)
- {
- for(boolean q : values)
- {
- for(boolean r : values)
- {
- for(boolean s : values)
- {
- compProp = (p || q || !r) && (p || !q || !s) && (p || !r || !s) && (!p || !q || !s) && (p || q || !s);
- System.out.println(p + " " + q + " " + r + " " + s + " " + ((p || q || !r) && (p || !q || !s) && (p || !r || !s) && (!p || !q || !s) && (p || q || !s)));
- if(compProp)
- {
- ans = "true";
- break;
- }
- }
- }
- }
- }
- System.out.print("The outcome of the compound proposition is " + ans);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement