Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

1. Define a Boolean predicate for each of the following statements: a. Tom\'s tr

ID: 3595327 • Letter: 1

Question

1. Define a Boolean predicate for each of the following statements: a. Tom's truck is red b. John's house is yellow c. Mary's car is blue 2. Declare a Java boolean variable for each of the Boolean predicates from the previous question. 3. Write a Boolean expression for each of the following statements, using the Boolean predicates in quest a. John's house is not yellow b. It is not the case that Mary's car is not blue c. Either Tom's truck is red, or Mary's car is blue and John's house is yellow d. It is true that both Tom's truck is red or Mary's car is blue, and John's house is yellow

Explanation / Answer

Let's take following Predicates to represent the statements

R = Tom's truck is red
Y = John's house is yellow
B = Mary's car is blue

// boolean is the type we used to represent it.

class Main{
   public static void main(String[] args)
   {
       boolean R = true;
       boolean Y = true;
       boolean B = true;
   }
}

Let's take following Predicates to represent the statements

R = Tom's truck is red
Y = John's house is yellow
B = Mary's car is blue

// boolean is the type we used to represent it.

class Main{
   public static void main(String[] args)
   {
       boolean R = true;
       boolean Y = true;
       boolean B = true;
   }
}