//I can't Understand
package com.codegym.task.task21.task2103;
/*
Everything ingenious is simple!
*/
public class Solution {
public static boolean calculate(boolean a, boolean b, boolean c, boolean d) {
return (a && b && c && !d) || (!a && c) || (!b && c) || (c && d);
}
public static void main(String[] args) {
}
}
Can You Please Help Me
Under discussion
Comments (3)
- Popular
- New
- Old
You must be signed in to leave a comment
Anonymous #11257937Expert
27 July 2023, 15:02
tried to simplify the problem using Boolean algebra:
(a・b・c・d') + (a'・c) + (b'・c) + (c・d)
= c(a・b・d' + a' + b' + d)
= c[a・b・d' + (a・b・d')'] // Boolean algebra rule: (x + y) = x'y'
= c // Boolean algebra rule: x + x' = 1
+2
Darek
16 June 2020, 10:31
Enter the entire Boolean expression into this calculator: https://www.dcode.fr/boolean-expressions-calculator.
See the result :)
0
Скидан Виталий
4 June 2019, 20:24
Only one argument of the method is important.
+2