Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

20 easy java questions?? 1. The logical structure in which one instruction occurs after another with no branching is a _____. a. case b. loop

20 easy java questions??

1.

The logical structure in which one instruction occurs after another with no branching is a _____.

a. case
b. loop
c. sequence

d. selection

2.

Which of the following is typically used in a flowchart to indicate a decision?

a. square
b. oval
c. rectangle

d. diamond

3.

An if statement is sometimes called a _____.

a. alternative decision
b. switch statement
c. single-alternative switch

d. single-alternative selection

4.

When you execute an ifelse statement, _____ takes place depending on the evaluation of the Boolean expression.

a. the second action always takes place and then the first action
b. only one of the resulting actions
c. the first action always takes place and then the second action

d. none of the actions

5.

In Java, the value of (4 > 7) is _____.

a. 4
b. true
c. 7

d. false

6.

If you want to take more than one action following the evaluation of a Boolean expression within an if statement, you use a pair of _____ to place the dependent statements within a block.

a. parentheses
b. square brackets
c. curly braces

d. colons

7.

When you declare a variable within a block, it _____.

a. cannot store a value
b. is available to every block within the program
c. is local to that block

d. is a class-level variable

8.

Statements in which an if statement is contained inside another if statement commonly are called _____ if statements.

a. switch
b. paired
c. nested

d. child

9.

An expression that combines Boolean tests into a single expression using the logical AND and OR operators are known as a(n) _____ condition.

a. compound
b. aggregate
c. double

d. included

10.

A _____ is a series of statements that determine to which of several consecutive series of values another value falls.

a. scope check
b. set test
c. list test

d. range check

11.

The operator that combines two conditions into a single Boolean value that is true only when both of the conditions are true, but is false otherwise, is _____.

a. ||
b. !!
c. &&

d. $$

12.

The operator that combines two conditions into a single Boolean value that is true when at least one of the conditions is true is _____.

a. ||
b. !!
c. $$

d. &&

13.

Assuming a variable f has been initialized to 5, which of the following statements sets g to 0?

a. All of the above statements set g to 0
b. if(f >= 0 || f < 2) g = 0;
c. if(f < 3 || f > 4) g = 0;

d. if(f > 6 || f == 5) g = 0;

14.

Which of the following groups has the lowest operator precedence?

a. logical OR
b. relational
c. addition

d. equality

15.

When you must make a series of decisions in a program, it is most efficient to first ask the question that is most likely to be _____.

a. false
b. not applicable to the user
c. highly unlikely

d. true

16.

The _____ feature is one in which expressions on each side of the && and || operators are evaluated only as far as necessary to determine whether the entire expression is true or false.

a. short-circuit evaluation
b. Boolean test
c. enumeration

d. range-check evaluation

17.

You can use the _____ statement to terminate a switch structure.

a. end
b. break
c. case

d. continue

18.

The switch statement is useful when you need to test a single variable against a series of any of the following values except a(n) _____.

a. int
b. string
c. char

d. double

19.

Which of the following shows the correct syntax for the conditional operator?

a. testExpression ? trueResult ? falseResult;
b. testExpression ? falseResult : trueResult;
c. testExpression : trueResult : falseResult;

d. testExpression ? trueResult : falseResult;

20.

Assuming a variable y has been assigned the value 6, the value of !(y < 7) is _____.

a. false
b. 6
c. true
d. 7

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_2

Step: 3

blur-text-image_3

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

Machine Learning And Knowledge Discovery In Databases European Conference Ecml Pkdd 2014 Nancy France September 15 19 2014 Proceedings Part 3 Lnai 8726

Authors: Toon Calders ,Floriana Esposito ,Eyke Hullermeier ,Rosa Meo

2014th Edition

3662448440, 978-3662448441

More Books

Students also viewed these Databases questions

Question

LOQ 13-2: How do attitudes and actions interact?

Answered: 1 week ago