Question: The following code segments have problems. I want you to attempt to run the code segments in a single class (Problem1). Identify and correct the
The following code segments have problems. I want you to attempt to run the code segments in a single class (Problem1). Identify and correct the errors; then re-run the code without errors. Please include the corrected code with the corrections as comments. Please show a screen capture of the problem code and corrected code.
a) while ( c <= 5 )
{
product *= c;
++c;
b) if ( gender == 1 )
System.out.println( "Woman" );
else;
System.out.println( "Man" );
c) while ( z >= 0 )
sum += z;
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
