Answered step by step
Verified Expert Solution
Link Copied!

Question

00
1 Approved Answer

Evaluate the truth values of the following conditions given the values of the declared variables. NOTE: Conditions formed using relational or equality operators (>, =,

Evaluate the truth values of the following conditions given the values of the declared variables. NOTE: Conditions formed using relational or equality operators (>, <, >=, <=, ==, !=) are relational conditions. Conditions formed using logical operators [&& (AND), || (OR), & (boolean AND), | (boolean inclusive OR), ^ (boolean exclusive OR) are complex conditions.

Variables

boolean goodEssay = false;

double gpa = 3.0;

boolean technicalDegree = true;

Conditions:Evaluate then indicate the truth value produced by the relational conditions and the joins. NOTE: Change in variable values do not carry over to next evaluation.

Truth Value of Complex Conditions

F (short-circuit)

goodEssay && technicalDegree || gpa > 3.0

FF

goodEssay && technicalDegree || gpa > 3.0

False

False

goodEssay && (technicalDegree == false) && (gpa >= 3.5)

!(technicalDegree && goodEssay)

goodEssay = true;

goodEssay & !(technicalDegree & (gpa != 3.0))

goodEssay ^ technicalDegree || (gpa == 5.0)

gpa = 3.5;

(goodEssay || technicalDegree) && (gpa > 3.25))

goodEssay & technicalDegree | (gpa == 4.0)

!goodEssay | (technicalDegree ^ (gpa >= 3.0))

Variables

int peopleInvited = 10;

double catering = 5000.00;

double facilityFee = 500.00;

Conditions:Evaluate then Indicate the truth value produced by the relational conditions and the joins. NOTE: Change in variable values do not carry over to next evaluation.

Truth Value of Complex Conditions

(facilityFee > 350.00) && (catering > 3000.00) | (++peopleInvited >= 10)

(peopleInvited > 10) || (catering >= 5000.00) && !(facilityFee < 500.00)

facilityFee = 1000.00

(peopleInvited >= 10) & (catering != 5000.00) || !(facilityFee < 1000.00)

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access with AI-Powered Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started