are allowed 20 // Create an object of Picture by loading an image Picture pic = Picture("starry_night.png"); 21 22 23 // Display the width and height System.out.println("Width :...


are allowed<br>20<br>// Create an object of Picture by loading an image<br>Picture pic = Picture(

Extracted text: are allowed 20 // Create an object of Picture by loading an image Picture pic = Picture("starry_night.png"); 21 22 23 // Display the width and height System.out.println("Width : System.out.println("Height: 24 25 + pic.getWidth()); + pic.getHeight()); 26 27 // Increase the width by 50 on both sides and // increase the height by 40 on both sides. // Must use dw and dh when calling method grow(). int dw, dh = 40; pic.grow(dw, dh); 28 29 30 31 32 33 // Display the width and height System.out.println("Width : System.out.println("Height: 34 + pic.getWidth()); + pic.getHeight()); 35 36 37 //Draw the picture draw(); 38 39 40 // Display the x and y coordinates of the top-left // System.out.printilne("X-coordinate: " System.out.printline("Y-coordinate: 41 corner of the picture 42 + Picture GetX()); + Picture GetY()); 43 44 45 46 47
9 public class PictureViewer<br>10{<br>public static void main(String[] args)<br>11<br>12<br>// Step 2: Fix the syntax errors and submit it<br>to Codecheck to pass the test.<br>// Note: Do not add or remove any statements<br>13<br>//<br>14<br>15<br>//<br>Do not change the semantics of each statement<br>Do not add or remove any variables<br>Do not add or remove any objects<br>Magic numbers are allowed<br>16<br>17<br>18<br>//<br>19<br>//<br>20<br>// Create an object of Picture by loading an image<br>Picture pic = Picture(

Extracted text: 9 public class PictureViewer 10{ public static void main(String[] args) 11 12 // Step 2: Fix the syntax errors and submit it to Codecheck to pass the test. // Note: Do not add or remove any statements 13 // 14 15 // Do not change the semantics of each statement Do not add or remove any variables Do not add or remove any objects Magic numbers are allowed 16 17 18 // 19 // 20 // Create an object of Picture by loading an image Picture pic = Picture("starry_night.png"); 21 22 23 // Display the width and height System.out.println("Width : " + pic.getWidth()); System.out.println("Height: 24 25 + pic.getHeight()); %3D 26 27 // Increase the width by 50 on both sides and // increase the height by 40 on both sides. // Must use dw and dh when calling method grow(). int dw, dh = 40; pic.grow(dw, dh); 28 29 30 31 32 33 // Display the width and height System.out.println("Width : System.out.println("Height: 34 + pic.getWidth()); + pic.getHeight()); 35 36 37 // Draw the picture draw(); 38 39 40 // Display the x and y coordinates of the top-left 41
Jun 10, 2022
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here