Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

1. if ( x == 1) ; y = 2; else if ( x == 2) ; y = 3; else if ( x == 3) ; y = 4; 2

ID: 3645899 • Letter: 1

Question

1. if ( x == 1) ;
y = 2;
else if ( x == 2) ;
y = 3;
else if ( x == 3) ;
y = 4;




2. if ( average = 100)
System. out. println( " Perfect Average! " ) ;




3. if ( num2 == 0)
System. out. println( " Division by zero is not possible. " ) ;
System. out. println( " Please run the program again " ) ;
System. out. println( " and enter a number besides zero. " ) ;
else
Quotient = num1 / num2;
System. out. print( " The quotient of " + Num1) ;
System. out. print( " divided by " + Num2 + " is " ) ;
System. out. println( Quotient) ;




4. switch ( score)
{
case ( score > 90) :
grade = ' A' ;
break;
case( score > 80) :
grade = ' b' ;
break;
case( score > 70) :
grade = ' C' ;
break;
case ( score > 60) :
grade = ' D' ;
break;
default:
grade = ' F' ;
}




5. The following statement should determine whether x is not greater than 20. What is
wrong with it?
if ( ! x > 20)

Explanation / Answer

1.no ; after if 2.double = in if 3.no brackets after if all 3 will be printed 4.it should be case : 5.if(x!=20)