Answered step by step
Verified Expert Solution
Question
1 Approved Answer
8. Write the static method canHide that takes two pictures (source and secret) and checks picture sizes to make sure you can hide the secret
8. Write the static method canHide that takes two pictures (source and secret) and checks picture sizes to make sure you can hide the secret in source. For now, this method should check if the two images are the same size, returning true if the two pictures have the same height and width, and false otherwise. This method will be modified in the following activity. Add code to main to test this method. * /** Determines whether secret can be hidden in source, which is * true if source and secret are the same dimensions. @param source is not null @param secret is not null @return true if secret can be hidden in source, false otherwise. * * public static boolean canHide (Picture source, Picture secret) 9. Write the static method hide Picture that takes two pictures (source and secret) and hides the secret in source using the algorithm previously discussed, returning the new picture. Add code to main to test this method. sk Creates a new Picture with data from secret hidden in data from source * @param source is not null @param secret is not null @return combined Picture with secret hidden in source * precondition: source is same width and height as secret */ * public static Picture hide Picture (Picture source, Picture secret) 8. Write the static method canHide that takes two pictures (source and secret) and checks picture sizes to make sure you can hide the secret in source. For now, this method should check if the two images are the same size, returning true if the two pictures have the same height and width, and false otherwise. This method will be modified in the following activity. Add code to main to test this method. * /** Determines whether secret can be hidden in source, which is * true if source and secret are the same dimensions. @param source is not null @param secret is not null @return true if secret can be hidden in source, false otherwise. * * public static boolean canHide (Picture source, Picture secret) 9. Write the static method hide Picture that takes two pictures (source and secret) and hides the secret in source using the algorithm previously discussed, returning the new picture. Add code to main to test this method. sk Creates a new Picture with data from secret hidden in data from source * @param source is not null @param secret is not null @return combined Picture with secret hidden in source * precondition: source is same width and height as secret */ * public static Picture hide Picture (Picture source, Picture secret)
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started