Write a program that reads several and/or conjunction/disjunction operations and prints their result.
Input will consist of several lines each containing
a boolean p
, an operator x
and a boolean q
separated by a single space.
Booleans p
and q
are either of the strings true
or false
and the operator x
is either of the strings and
or or
.
Output should contain a line with the result of the given input operation.
Example input
true and false
false or true
Example output
false
true
The submitted program should contain the conjunction
and disjunction
functions
that receive two boolean as arguments and return a boolean.
Please refer to the information for the chosen language:
def conjunction(p, q):
, def conjunction(p, q):
int conjunction(int p, int q);
, int conjunction(int p, int q);
conjunction, disjunction :: Bool -> Bool -> Bool
bool conjunction(bool p, bool q);
, bool conjunction(bool p, bool q);
Copyright © 2020-2021 Rudy Matela
All rights reserved