Checkpoint 1.3.2.
Consider the following Java function and fill in the blank parts in the truth table.
public static String message(int age, boolean didConsent) {
if (age >= 18 && didConsent) {
return "You can participate in the study";
}
return "Sorry, you cannot participate";
}
age >= 18 | didConsent | Output |
true | true | "You can participate in the study" |
true | --Blank 1--- | "Sorry, you cannot participate" |
false | ---Blank 2--- | "Sorry, you cannot participate" |
false | false | ---Blank 3--- |
Write your responses here:
Blank 1:
Blank 2:
Blank 3: