if(payRate < 5.85 && payRate > 60)
System.out.println("Error in pay rate");
System.out.println("This prints forever.");
}
Identify the problem that exists in the above while loop.
}
System.out.println("Balance is " + balance);
while (true) {
if (balance < 9)
continue;
balance = balance - 9;
}
System.out.println("Balance is " + balance);
4. Making a comparison to 0 is slower than making a comparison to any other value.
a. True b. False
5. How many times will outputLabel be called?
for(int customer = 1; customer <= 20; ++customer)
for(int color = 1; color <= 3; ++color)
outputLabel();
a. 0 b. 3
1
&& condition check the both condition here suppose pay rate is 10 then first is false and secnnd is true but overall is false so statement inside the if will not execute s use or condition
if(payRate < 5.85 || payRate > 60)
System.out.println("Error in pay rate");
2
while(10 > 1){
System.out.println("This prints forever.");
}
here while is always true so it will execute infinite time.
3
break :- it is used to come out the loop of parent
continue:- when continue word get execute it will jump to next iteration without executing below of the statement
a) Balance is 1
b)basically it will show error that unreachable statement
4
false
5 d) 60
Get Answers For Free
Most questions answered within 1 hours.