Popular posts from this blog
Iterables In Java Main Quiz --Java Programming: Solving Problems with Software 1
By
Unknown
-
The function swapRedGreen has one parameter, a pixel. This function swaps the red and green values and returns the resulting red, green and blue values somehow. Which one of the following is the correct code for this function?
// write your code here function swapRedGreen(pixel) { var newGreen = pixel.getRed(); var newRed = pixel.getGreen(); pixel.setGreen(newGreen); pixel.setRed(newRed); return pixel; } var image = new SimpleImage ("eastereggs.jpg"); print (image); for ( var pixel of image.values()){ if (swapRedGreen(pixel) ){ } } print (image);

Comments
Post a Comment