I understand overloading but what does someone mean by "Overload the increaseRed method with an increaseRed method that accepts a number that specifies an increase factor"?

The increasedRed() is as follows:

 public void increaseRed()
{
  Pixel[] pixelArray = this.getPixels();
  Pixel pixel = null;
  int value = 0;
  int index = 0;

  // loop through all the pixels
  while (index < pixelArray.length)
  {
    // get the current pixel
    pixel = pixelArray[index];

    // get the value
    value = pixel.getRed();

    // change the value to 1.3 times what it was
    value = (int) (value * 1.3);

    // set the red value to 1.3 times what it was
    pixel.setRed(value);

    // increment the index
    index++;
  }
}

Does this make sense?

public void IncreaseRed ( int percent )
{
Pixel [] pixelArray = this.getPixels();
int red = 0 ;
double factor = 1 . 0 - ( percent / 1 0 ) ;
// loop through a l l the p i x e l s
for ( Pixel currPixel: pixelArray )
{
red = currPixel . getRed() ;
currPixel.setRed ( ( int ) ( red * factor ) ) ;
}
}

I understand overloading but what does someone mean by "Overload the increaseRed method with an increaseRed method that accepts a number that specifies an increase factor"?

this line alone tells me you don't understand overloading.

Wow no answer

this one tells me you don't recognize an answer when given one. what kind of answer are you expecting?

This article has been dead for over six months. Start a new discussion instead.