Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Question 1. Assume the following (int) values for a set of variables: a = 5; b = 17; c = 27; d = -1; Then,

Question 1. Assume the following (int) values for a set of variables:

a = 5; b = 17; c = 27; d = -1;

Then, does the following boolean expression evaluate as true or false?

((a < 5) && (b > 10)) || ((c < 3) || (d < 0))

a.

false

b.

true

QUESTION 2

If you want to compare the String variable myvar and the literal "Yes" which boolean expression would you use? __________________________.

a.

(myvar is "Yes")

b.

("Yes".equals(myvar))

c.

(myvar == Yes)

d.

None of the above

QUESTION 3

The following is a syntactically correct Java if statement.

if (rand == 1) { c_pick = ROCK; } else if (rand == 2) { c_pick = PAPER; } else { c_pick = SCISSORS } }

a.

false

b.

true

QUESTION 4

Which of the following can be used in the boolean condition of a Java if statement? ___________________.

a.

<, <=, >, >=

b.

==, !=

c.

&&, ||

d.

All of the above

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored 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

Recommended Textbook for

How Do I Use A Database Research Tools You Can Use

Authors: Laura La Bella

1st Edition

1622753763, 978-1622753765

More Books

Students also viewed these Databases questions

Question

2. What type of team would you recommend?

Answered: 1 week ago