Question: / / Keep the step instructions and add your code below them. / * * * Load and draw a picture. * * Step 1

// Keep the step instructions and add your code below them.
/**
* Load and draw a picture.
*
* Step 1: Enter your name for @author and today's date for @version
*
* @author
* @version
*/
public class PictureExpander
{
public static void main(String[] args)
{
// Step 2: Create a picture object pic and load
// picture "beautifulSunset.jpg"
// Declare an object:
Picture pic = new Picture("beautifulSunset.jpg");
// Step 3: Draw the picture
// Call a method on the object:
pic.draw();
// Print a statement indicating where we are in the code
System.out.println("Before translation and grow:");
// Step 4: Complete the statement to
// display the (x, y) coordnates of the picture
System.out.println("X-coordinate: 0");
System.out.println("Y-coordinate: 0");
// Step 5: Complete the statement to
// display the size of the picture
System.out.println("Width : 400");
System.out.println("Height: 300");
// Step 6: Translate the picture 150 to the right
// and 100 units down
// Print a statement indicating where we are in the code
System.out.println("After translation:");
// Step 7: Complete the statement to
// display the (x, y) coordnates of the picture
System.out.println("X-coordinate: 150");
System.out.println("Y-coordinate: 100");
// Step 8: Complete the statement to
// display the size of the picture
System.out.println("Width : 400");
System.out.println("Height: 300");
// Before completing steps 9,10, and 11, compile and run this code
// to see what the translate command did
// Step 9: Enlarge the picture by 100 pixels to the left and right
// and 80 pixels up and down
// Print a statement indicating where we are in the code
System.out.println("After grow:");
// Step 10: Complete the statement to
// display the (x, y) coordnates of the picture
System.out.println("X-coordinate: 100");
System.out.println("Y-coordinate: 80");
// Step 11: Complete the statement to
// display the size of the picture
System.out.println("Width : 600");
System.out.println("Height: 460");
}
}

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!