Modify any of the methods to use a nested loop. Run it to make sure it still works.
What will be an ideal response?
```
public void negateN e s te d ( )
{
Pixel pixel = null;
int redValue , blueVal ue , greenV al ue = 0 ;
//loop through all the pixels
for ( int x = 0 ; x < this . getWidth ( ) ; x++)
{
for ( int y = 0 ; y < this . getHeight ( ) ; y++)
{
pixel = this . get Pixel ( x , y ) ;
// get the current red , green , and blue values
redValue = pi xel . getRed ( ) ;
greenValue = pixel . getGreen ( ) ;
blue Value = pixel.getBlue ( ) ;
// s e t t h e p i x e l ’ s c o l o r t o t h e new c o l o r
pixel.set Color (new Color (255 ? redValue ,
255 - green value,
255 ? blue Value ) ) ;
}
}
}
```
You might also like to view...
The most powerful and most efficient programs are written in __________ language.
Fill in the blank(s) with correct word
Binary Search is in the complexity class
A) O(1) B) O(log n) C) O(n) D) O(n log n)
When software that was deployed using group policy and Windows Installer becomes outdated or is no longer useful to your company, you can use a GPO to remove the software. Software removal can be either ________________________
a. Mandatory or optional b. Optional or permissive c. Mandatory or permissive d. None of the above.
During the ______ phase of the software life cycle, formal methods may be used to prove the correctness of an algorithm.
a) specification b) verification c) testing d) design