I am currently studying for my Java exam and I am stuck on two questions:
1. Which answer is most accurate. An if statement :
A. contains an else clause
B. allows a choice of statements to be executed
C. may iterate multiple times
D. should end with a break statement
2. Which answer is most accurate. An else statement :
A. contains an else clause
B. should end with a break statement
C. may iterate multiple times
D. allows a choice of statements to be executed
Could anyone give me some guidance on this please.
If Else Statements
Page 1 of 15 Replies - 984 Views - Last Post: 27 May 2012 - 08:42 AM
Replies To: If Else Statements
#2
Re: If Else Statements
Posted 10 May 2012 - 06:08 AM
well try this
if {i eat}
I will not be hungry
else
I will be hungry
if {i eat}
I will not be hungry
else
I will be hungry
#3
Re: If Else Statements
Posted 10 May 2012 - 06:21 AM
1 is obviously "allows a choice of statements," but 2 is confusing. There's no such thing as an "else statement," formally speaking. There is however an "if/else" or just plain "if" statement. For 2, having to choose between A and D, I'd say the most accurate statement is A.
This post has been edited by blackcompe: 10 May 2012 - 06:22 AM
#4
Re: If Else Statements
Posted 10 May 2012 - 06:24 AM
I think 2 was written to confuse the reader either that or the person who wrote it had no clue what they were talking about...
1. B
2. A
1. B
2. A
#6
Re: If Else Statements
Posted 27 May 2012 - 08:42 AM
c9-adams, on 10 May 2012 - 05:57 AM, said:
I am currently studying for my Java exam and I am stuck on two questions:
1. Which answer is most accurate. An if statement :
A. contains an else clause
B. allows a choice of statements to be executed
C. may iterate multiple times
D. should end with a break statement
2. Which answer is most accurate. An else statement :
A. contains an else clause
B. should end with a break statement
C. may iterate multiple times
D. allows a choice of statements to be executed
Could anyone give me some guidance on this please.
1. Which answer is most accurate. An if statement :
A. contains an else clause
B. allows a choice of statements to be executed
C. may iterate multiple times
D. should end with a break statement
2. Which answer is most accurate. An else statement :
A. contains an else clause
B. should end with a break statement
C. may iterate multiple times
D. allows a choice of statements to be executed
Could anyone give me some guidance on this please.
1 would be B, 2 would be A.
For and While loops would most resemble C. A case clause within a Switch statement should end with a break statement.
Page 1 of 1
|
|

New Topic/Question
Reply


MultiQuote





|