18.9. Mixed-Up Code Exercises

Arrange the code blocks to set the green in all pixels to 0. Be sure to indent properly and look out for extra code blocks!

Arrange the code to set the red in all pixels equal to the blue value. It also should set the green and blue in all pixels to 255. Be sure to indent correctly and be careful for extra code blocks!

Arrange the code to reduce the green in all pixels by 75%. Be sure to indent correctly and look out for extra code blocks!

Arrange the following code blocks to set the red value equal to 1.5x the blue value. Be sure to indent correctly and look out for extra code blocks!

The following program is supposed to decrease the red by 0.6, increase the blue by 0.6, and set the green to 0, but the code blocks are out of order. Drag and drop the blocks to put them in the correct order.

The following program should make the picture completely white, but the lines are mixed up. Be sure to indent correctly and watch out for extra code blocks!

The following program should set the red of every other pixel to 0, but the lines are mixed up. Drag and drop the code blocks into the correct order – make sure to indent correctly!

The following program should only change the color of the pixels in the bottom left quadrant. The code should set the red to the blue value, the green to the red value, and the blue to the green value. Rearrange the following code blocks to accomplish this. Be sure to indent correctly and watch out for extra code blocks.

Arrange the following program so that the right side of the image is copied onto the left side. Be sure to indent correctly!

The following program is intended to copy the pixels from the top quarter of the image to the bottom quarter of the image. Drag and drop the code blocks into the correct order. Be sure to indent properly and be mindful of extra code blocks!

You have attempted of activities on this page