What is the first file your group looks at and why? What are the first (and most important) things that your group takes notice of in the code in this file? Answer #A.1
The first file we look at is the Image file because that is where all the methods are being compiled to get the out for the main method in
TestImage. We take notice of the different methods and constructors being created in the class such as Throws exception and BufferedImage.
Question #A.2
What happens in the constructor?
Answer #A.2
The constructor is supposed to throw an exception with a String type called filename. Question #A.3
Find the read method (note that the read method is not complete). How many parameters does the read method take and what are their …show more content…
Question #D.3 + coding
You want to make a new Image object using the Image class that you finished. What type of parameter does your Image class constructor require? Inside of the try-block, create a new Image object using the animals image provided. \ Make sure that the animals.jpg file, …show more content…
Then, call the draw method on the Image object that you just created and pass in the Graphics object, 10 for the parameter x, and 40 for the parameter y. Compile and run the TestImage class.
Answer #D.3
For creating a new Image using the Image class already created, the new
Image will require a file parameter of animals.jpg since that is the name of the file we are going to be using. Knowing the exact file being used will present this image when compiling the code.
Part E: Manipulating the image
After all that work trying to understand the other programmer’s code, you are ready to write your own code to manipulate the image.
Question #E.1 + coding
The first method that your boss wants you to create in the Image class is named flipY. This method should take the image and flip it around the yaxis.
Think of this as what you would see if you looked at the image in a mirror. Everything would be reversed horizontally, but not vertically (i.e. not upside-down). Should your method take any parameters? Why or why not? Should your method return anything? Why or why not? Create the code for this method and then compile. Then, call your method on