1.This fragment:

if (alpha >= beta) charlie = delta; else epsilon = foxtrot;

is equivalent to which of the following?

A

if (alpha >= beta); charlie = delta; if (alpha < beta); epsilon = foxtrot;

B

if (beta < alpha) charlie = delta; else epsilon = foxtrot;

C

if (beta >= alpha) charlie = delta; else epsilon = foxtrot;

D

if (beta <= alpha) charlie = delta; else if (beta > alpha) epsilon = foxtrot;

When I looked over the problem again I got answer D because it still basically says if alpha is greater than or equal to beta then charlie = delta and if beta is greater than alpha then epsilon = foxtrot

2.

What is printed?

int result = 2;

int cnt = 5;

for (cnt = 0; cnt < 5; cnt++);

result += cnt;

System.out.println("result = " + result);

A. result = 17

B. result = 5

C. result = 12

D. result = 7

the first time I took this quiz I put C now that I'm looking at it I got A becuase metally if cnt=0 and cnt is less than 5 and cnt ++ then written out wouldn't the equation look a little like this. (5+4+3+2+1)=15 then result+= cnt will be

result= 15+2 so therefore result = 17 would be the answer.

3.

What is the value of the int variable d after the following statement is executed?

for (d = 1; d < 567; d *= 10);

A. 1

B. 10

C. 1000

D. 100

For this problem I was utterly confused and took a blind stab at it on the quiz, now that I have the time to look at it, the problem seems very simple. Wouldn't the answer be B. because since d = 1 and d* = 10 then wouldn't I multiply 1 by 10 or 1 * 10 and the answer would be 10?