Question

In: Computer Science

The logical operator ______________________ takes one operand and inverts its value, changing true to false and...

  1. The logical operator ______________________ takes one operand and inverts its value, changing true to false and false to true.

A.

&&

B.

!=

C.

II

D.

!

The ___________________ operator takes two boolean expressions as operands; if both are true, then the result is true; otherwise the result is false.

A.

$$

B.

&&

C.

||

D.

!

  1. What is the order of precedence of the operators that Java uses to evaluate a condition and selection statements to choose which instructions to execute based on whether a condition evaluates to true or false?

A.

Equality operators, relational operators, logical OR, logical NOT, and logical AND.

B.

Logical OR, Logical NOT, relation operators, equality operators, logical AND.

C.

Relational operators, logical AND, equality operators, logical NOT, logical OR.

D.

Logical NOT, relation operators, equality operators, logical AND, logical OR.

  1. The ________________ statement evaluates an integer or character expression or a String, then compares the expression's value to case constants.

A.

switch

B.

nested if

C.

if

D.

if else

  1. The __________________ operator is used in expressions where one or two values should be used depending on the evaluation of a condition.

A.

if

B.

?:

C.

else

D.

II

  1. When we need exact precisions in calculations with decimal numbers, we can use the ________________________ class in the Java Class Library.

A.

RoundingMode

B.

BigInteger

C.

BigDecimal

D.

MathContext

  1. The ___________________________ statement is used o perform certain set of operations for one set of data and do nothing for all other data.

A.

nested if

B.

if/else

C.

if

D.

switch

  1. The ___________________________ statement is used o perform certain set of operations for one set of data and other operations for all other data.

A.

case

B.

if

C.

switch

D.

if/else

  1. ________________ repeats a set of operations for each input item while a condition is true.

A.

sentinel testing

B.

control testing

C.

nesting

D.

looping

  1. The ____________ loop is especially useful for event-controlled looping.

A.

for

B.

while

C.

do while

D.

if/else

  1. If the loop condition evaluates to false ____________________________________________

A.

the body of the while loop is executed.

B.

the last item is evalauted.

C.

the first item is evaluated.

D.

the program immediately terminates.

  1. A sentinel value in the loop signals ________________________________

A.

the type of loop to be executed.

B.

the number of total items to be processed.

C.

the end of items to be processed.

D.

the beginning of items to be procesed.

  1. The ____________________ loop checks the loop condition after executing the loop body.

A.

both for loop and while loop.

B.

while

C.

for

D.

do/while

  1. The ________________ loop is useful for count-controlled loops, that is, loops for which the number of iterations is known when the loop begins.

A.

while

B.

do/while

C.

for

D.

both do/while and for

  1. When the for loop is encountered, what happens first?

A.

the loop body is executed.

B.

the initialization statement is executed.

C.

the loop condition is evalauted.

D.

the loop update statement is executed.

Solutions

Expert Solution

1.The logical operator ------------ takes one operand and inverts its value changing true to false and false to true

Answer : ! (not operator )performs one operand and inverts its value changinig true to false and false to true

2.The -------------- operator takes two boolean expression as operands if both are true ,then the results is true;otherwise the result is false

Answer: && operator performs two expressions are true than output is true otherwise false

3. What is the order of precedence of the operators that java uses to evalute a condition and selection statements to choose which instructions to executes based on whether a condition evalutes true or false?

Answer: LOgical operator, relational operator, equality operator, logical AND , logical OR

4. The ----------- statements evalutes an integer or character expression or string , then compares the expression's value to case constants.

Answer: Switch Statement evalutes int, char,string expressions are evalute

5. The ------------- operator is used in expression where one or two values should be used depending on the evalution of a condition

Answer: ?: (conditional operator) is evalutes one or two values be evalution of a condition

6.When we need to exact precision in calculations with decimal numbers, we can use the -------------- class in the java class library

Answer: BigDecimal

7. The ------------- statement is used to perform certain set of operations for one set of data and do nothhing for all other data

Answer: if statement is used to perform if condition is true and set of operations perform than nothing about all other data

8. The ----------statement is used to perform certain set of operations for one set of data for all other data

Answer: else-if statement is perform set of operations for all other data

9.------------ repeats a set of operations for each input item while a condition is true

Answer : looping is repeats opetations until condition is true

10. The ----------- loop is especially useful for event- controlled looping

Answer: do-while loop is a event-controlled loop

11. if the loop condition evalutes to false------------

Answer: the loop is immediately terminates

12. A sentinel value in the loop signals ----------

Answer: the type of loop is executed

13. The -------------- loop checks the loop condition after executing the loop body

Answer: both for and while loop

14. The -------------- loop is useful for count -controlled loops that is loops for which the number of iterations is known when the loop begins

Answer: both while and for

15. When the for loop is encounted ,what happens first ?

Answer: the initialization statement is executed first

please upvote rating my answer and my answers are correct please rating my answer


Related Solutions

Evaluate the following logical expression. Choose True if the expression evaluates to true; choose False if...
Evaluate the following logical expression. Choose True if the expression evaluates to true; choose False if the expression evaluates to false. (3 * 5 > 10) || (20 < 15) True False Evaluate the following logical expression. Choose True if the expression evaluates to true; choose False if the expression evaluates to false. "Medium" < "High" True False Evaluate the following logical expression. Choose True if the expression evaluates to true; choose False if the expression evaluates to false. (4...
An option is said to be “in‐the‐money” if its value is positive. True or False
An option is said to be “in‐the‐money” if its value is positive. True or False
True or False: Logical database design is the process of modifying the physical database design to...
True or False: Logical database design is the process of modifying the physical database design to improve performance. The two major logical database design techniques are conversion of E-R diagrams to relational tables and data normalization. Multivalued attributes are not permitted in unnormalized data. A many-to-many binary relationship in an E-R diagram requires the creation of a total of three tables in a relational database. A one-to-one unary relationship in an E-R diagram requires the creation of a total of...
Answer TRUE or FALSE for the below: a) Changing an estimated useful life for an item...
Answer TRUE or FALSE for the below: a) Changing an estimated useful life for an item of depreciable property will likely entail restating financial statements of prior years. b) Warranty expense is not recorded until the actual warranty work is performed. c) Preferred stock has a "preference" ahead of common stock for both dividends and liquidation proceeds. d) Salvage value is ignored during the early years of life for an asset that is to be depreciated under the straight-line method....
1. True or False: In a price-taker market, if a business operator produces inefficiently—and the cost...
1. True or False: In a price-taker market, if a business operator produces inefficiently—and the cost of producing the good is maximized—the operator will be able to make at least a normal profit. 2. True or False: When the firms in the industry are just able to cover their cost of production, economic profit is zero. Therefore, if demand falls, causing prices to go down even a little bit, economic profits will be negative in the long run.
18. TRUE OF FALSE: Payback is the number of years it takes for the project to...
18. TRUE OF FALSE: Payback is the number of years it takes for the project to pay for itself, without regard to the time value of money. 19. TRUE OF FALSE: The high profitability index means that the company will achieve the highest NPV per dollar of investment. 20. TRUE OR FALSE: NPV is the best method for capital rationing situations. 21. TRUE OR FALSE: In some cases, NPV and IRR will rank projects differently. 22. TRUE OR FALSE: Under...
true or false ‏____ 5. One key value of limited liability is that it lowers owners'...
true or false ‏____ 5. One key value of limited liability is that it lowers owners' risks and thereby enhances a firm's value. ‏____ 6. If a firm's goal is to maximize its earnings per share, this is the best way to maximize the price of the common stock and thus shareholders' wealth. ‏____ 7. If Firm A's business is to obtain savings from individuals and then invest them in financial assets issued by other firms or individuals, Firm A...
True or False. Changing the aromatic substituents on a pyrylium salt will change the oxidizing power...
True or False. Changing the aromatic substituents on a pyrylium salt will change the oxidizing power of the pyrylium salt.
A low value of opportunity cost of a resource reflects its scarcity. True False Which of...
A low value of opportunity cost of a resource reflects its scarcity. True False Which of the following is an example of a macroeconomic question? How will a consumer react if their income decreases? What would be the likely impact of an increase in business taxes on the overall level of inflation in the country? How many smartphones should Samsung produce this quarter? Who are the winners and losers from the imposition of a tax on cigarettes? What is the...
True or False. Please give an explanation as to why its true or false. Too much...
True or False. Please give an explanation as to why its true or false. Too much leverage on a company’s balance sheet will increase the company’s cost of equity/
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT