Java 1: 1) Choose a for statement header that will vary the control variable x i
ID: 3809919 • Letter: J
Question
Java 1:1) Choose a for statement header that will vary the control variable x in increments of 5 from 0 up through 100; then choose a for statement header that decrements by 5 from 100 to 0. You don't have to code a body. Choose all the answers that are correct. All or nothing.
a. for(int x = 100; x >= 0; x-5)
b. for(int x = 0; x < 100; x += 5)
c. for(int x = 0; x <= 100; x += 5)
d. for(int x = 100; x >= 0; x -= 5)
e. for(int x = 0; x <= 100; x++)
f. for(int x = 100; x <= 0; x -= 5)
2) Given: boolean spinach = false; boolean lasagna = true; char salad = 'y'; spinach ^ lasagna && salad == ‘y’ Choose all the answers that are correct. All or nothing.
a. lasagna && salad == 'y' will be evaluated last.
b. spinach ^ lasagna will be evaluated first.
c. The truth value of the complex condition is "true".
d. The truth value of spinach ^ lasagna will be joined with the truth value for salad == 'y' by the &&.
e. The truth value of the complex condition is "false".
f. lasagna && salad == 'y' will be evaluated first. Java 1:
1) Choose a for statement header that will vary the control variable x in increments of 5 from 0 up through 100; then choose a for statement header that decrements by 5 from 100 to 0. You don't have to code a body. Choose all the answers that are correct. All or nothing.
a. for(int x = 100; x >= 0; x-5)
b. for(int x = 0; x < 100; x += 5)
c. for(int x = 0; x <= 100; x += 5)
d. for(int x = 100; x >= 0; x -= 5)
e. for(int x = 0; x <= 100; x++)
f. for(int x = 100; x <= 0; x -= 5)
2) Given: boolean spinach = false; boolean lasagna = true; char salad = 'y'; spinach ^ lasagna && salad == ‘y’ Choose all the answers that are correct. All or nothing.
a. lasagna && salad == 'y' will be evaluated last.
b. spinach ^ lasagna will be evaluated first.
c. The truth value of the complex condition is "true".
d. The truth value of spinach ^ lasagna will be joined with the truth value for salad == 'y' by the &&.
e. The truth value of the complex condition is "false".
f. lasagna && salad == 'y' will be evaluated first. Java 1:
1) Choose a for statement header that will vary the control variable x in increments of 5 from 0 up through 100; then choose a for statement header that decrements by 5 from 100 to 0. You don't have to code a body. Choose all the answers that are correct. All or nothing.
a. for(int x = 100; x >= 0; x-5)
b. for(int x = 0; x < 100; x += 5)
c. for(int x = 0; x <= 100; x += 5)
d. for(int x = 100; x >= 0; x -= 5)
e. for(int x = 0; x <= 100; x++)
f. for(int x = 100; x <= 0; x -= 5)
2) Given: boolean spinach = false; boolean lasagna = true; char salad = 'y'; spinach ^ lasagna && salad == ‘y’ Choose all the answers that are correct. All or nothing.
a. lasagna && salad == 'y' will be evaluated last.
b. spinach ^ lasagna will be evaluated first.
c. The truth value of the complex condition is "true".
d. The truth value of spinach ^ lasagna will be joined with the truth value for salad == 'y' by the &&.
e. The truth value of the complex condition is "false".
f. lasagna && salad == 'y' will be evaluated first.
Explanation / Answer
1 answer
c.
for(int x = 0; x <= 100; x += 5)
d.
for(int x = 100; x >= 0; x -= 5)
Answer 2
home / study / engineering / computer science / questions and answers / java 1: 1) choose a for statement header that ...
Question: Java 1: 1) Choose a for statement header that wil...
Java 1:
1) Choose a for statement header that will vary the control variable x in increments of 5 from 0 up through 100; then choose a for statement header that decrements by 5 from 100 to 0. You don't have to code a body.
Choose all the answers that are correct. All or nothing.
a.
for(int x = 100; x >= 0; x-5)
b.
for(int x = 0; x < 100; x += 5)
c.
for(int x = 0; x <= 100; x += 5)
d.
for(int x = 100; x >= 0; x -= 5)
e.
for(int x = 0; x <= 100; x++)
f.
for(int x = 100; x <= 0; x -= 5)
2) Given:
boolean spinach = false;
boolean lasagna = true;
char salad = 'y';
spinach ^ lasagna && salad == ‘y’
Choose all the answers that are correct. All or nothing.
b.
spinach ^ lasagna will be evaluated first.
c.
The truth value of the complex condition is "true".
d.
The truth value of spinach ^ lasagna will be joined with the truth value for salad == 'y' by the &&.
Precedence of ^ is greater than && so answer B is correct
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.