Question
what are the answers

Which detects if x is in the range -4 to +4? (x < -5) AND (* < 5) O (x >-5) AND (* < 5) O (X <-5) OR (x < 5) O (x > -5) OR (*
If the final else branch executes, what must userNum have been? Type unknown if appropriate. if (userNum < 9) { > else if (
If x is 5 and y is 7, indicate which expression evaluates to false. Ox=5 Oy!= 7 Oy != 99 x <= 7
Determine the final value of numBoxes. numBoxes = 0; numApples - 9; if (numApples < 10) { numBoxes - 2 if (numApples < 20){ n
What import statement must be used to generate random numbers? import java.util.Random; import java.util.Number; import java.
Which of the following is correct? int is a data type of size 8 bits. short is a data type of size 16 bits. int and double ty
Assume that variable x is declared as int, which uses 32 bits. Which of the following statements does not cause integer overf
Given the following statements: firstString - ser.next(); secondString - scnr.next(); indicate what string will be put into s
The following statement declares and assigns userName with Sarah. String userName = Sarah; String userName = Sarah; int u
If the goal output is: Say Hello what needs to be written inside of the parenthesis in the print statement? System.out.prin
0 0
Add a comment Improve this question Transcribed image text
Answer #1

1. Which detects if x is in the range -4 to +4?
Answer: (x > -5) and (x < 5)

2. For the final else to execute, must be between 9 and 11 (both excluded)
Answer: 10

3. y != 7 will be false because y is equal to 7

4.
numBoxes = 0;
numApples = 9;

if (numApples < 10) { // true
numBoxes = 2;
}
if (numApples < 20) { // true
numBoxes = numBoxes + 1;
}

Since both the if conditions are true, num boxes will be set to 2 in the first if block and will be increased by 1 in the second if block.
Answer: 2 + 1 = 3

Add a comment
Know the answer?
Add Answer to:
what are the answers Which detects if x is in the range -4 to +4? (x...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT