Question: Write a method isSame that takes two pictures and checks to see if the two pictures are exactly the same ( returns true or false.
Write a method isSame that takes two pictures and checks to see if the two pictures are exactly the same returns true or false.
This is part of the APCSA Steganography Lab, activity I have written a method that compares the RGB values of each Pixel object in each picture's D array, but it does not work, and always returns true.
I am unsure why it fails. Code is below
Pixel pArr pgetPixelsD;
Pixel pArr pgetPixelsD;
ifpArrlength pArr.length pArrlength pArrlength
return false;
forint k ; k pArr.length; k
forint j ; j pArrlength; j
int r pArrkjgetRed;
int r pArrkjgetRed;
int g pArrkjgetGreen;
int g pArrkjgetGreen;
int b pArrkjgetBlue;
int b pArrkjgetBlue;
ifr r g g b b
return false;
return true;
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
