Ifs Work Sheet
By Mickey Arnold
starstarstarstarstarstarstarstarstarstar
Last updated 10 months ago
5 Questions
DIRECTIONS : Fill in each blank with the correct answer/output. Assume each statement happens in order and that one statement may affect the next statement.
Some sections might print more than once.
1 point
1
Question 1
1.
int i=3;if( i < 7) out.println("aplus");out.println("compsci");
int i=3;
if( i < 7)
out.println("aplus");
out.println("compsci");
1 point
1
Question 2
2.
int x=13;if( x < 7) out.println("aplus");out.println("compsci");
int x=13;
if( x < 7)
out.println("aplus");
out.println("compsci");
1 point
1
Question 3
3.
int b=7, c=11;if( b < 10 ) out.println("aplus");if( c > 10 ) out.println("howdy");out.println("compsci");
int b=7, c=11;
if( b < 10 )
out.println("aplus");
if( c > 10 )
out.println("howdy");
out.println("compsci");
1 point
1
Question 4
4.
int e=7, f=11;if( e < 10 ) out.println("aplus");if( f < 10 ) out.println("howdy");out.println("compsci");
int e=7, f=11;
if( e < 10 )
out.println("aplus");
if( f < 10 )
out.println("howdy");
out.println("compsci");
1 point
1
Question 5
5.
int w=52;if(w<10) out.println("aplus");if(w>10) out.println("compsci");
int w=52;
if(w<10)
out.println("aplus");
if(w>10)
out.println("compsci");