Complete the code to check if a number is positive.
if (number [1] 0) { print('Positive'); }
The condition should check if the number is greater than zero to be positive.
Complete the for loop to print numbers from 0 to 4.
for (int i = 0; i [1] 5; i++) { print(i); }
The loop should run while i is less than 5 to print 0 to 4.
Fix the error in the while loop condition to stop at 3.
int count = 0; while (count [1] 3) { print(count); count++; }
The loop should run while count is less than or equal to 3 to include 3.
Fill both blanks to create a for loop that prints even numbers from 2 to 6.
for (int i = [1]; i [2] 6; i += 2) { print(i); }
The loop starts at 2 and runs while i is less than or equal to 6 to include 6.
Fill all three blanks to create a switch statement that prints the day name for 1, 2, or 3.
switch(day) {
case [1]:
print('Monday');
break;
case [2]:
print('Tuesday');
break;
case [3]:
print('Wednesday');
break;
default:
print('Invalid day');
}The cases should match the day numbers 1, 2, and 3 for Monday, Tuesday, and Wednesday.
