Getting error....picture scaleUp method
public Picture scaleUp(int numTimes)
{
Picture targetPicture = new Picture(this.getWidth()*numTimes, this.getHeight()*numTimes);
Pixel sourcePixel = null;
Pixel targetPixel = null;
int targetX = 0;
int targetY = 0;
for(int sourceX = 0; sourceX < this.getWidth(); sourceX++)
{
for(int sourceY = 0; sourceY < this.getHeight(); sourceY++)
{
sourcePixel = this.getPixel(sourceX,sourceY);
for(int indexY = 0; indexY < numTimes(); indexY++)
{
for(int indexX = 0; indexX < numTimes(); indexX++)
{
targetX = sourceX * numTimes + indexX;
targetY = sourceY * numTimes + indexY;
targetPixel = targetPicture.getPixel(targetX, targetY);
targetPixel.setColor(sourcePixel.getColor());
}
}
}
}
return targetPicture;
}
Errors
File: C:\intro-prog-java\bookClasses\Picture.java [line: 97]
Error: cannot find symbol
symbol : method numTimes()
location: class Picture
File: C:\intro-prog-java\bookClasses\Picture.java [line: 99]
Error: cannot find symbol
symbol : method numTimes()
location: class Picture