Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

I need help with Java: Creating and exploring other pictures Here is the main method in the class PictureExplorer. Every class in Java can have

I need help with Java:

Creating and exploring other pictures Here is the main method in the class PictureExplorer. Every class in Java can have a main method, and it is where execution starts when you execute the command java ClassName. public static void main( String args[]) { Picture pix = new Picture("beach.jpg"); pix.explore(); } The body of the main method declares a reference to a Picture object named pix and sets that variable to refer to a Picture object created from the data stored in a JPEG file named beach.jpg in the images folder. A JPEG file is one that follows an international standard for storing picture data using lossy compression. Lossy compression means that the amount of data that is stored is much smaller than the available data, but the part that is not stored is data we won't miss. Exercises 1. Modify the main method in the PictureExplorer class to create and explore a different picture from the images folder. 2. Add a picture to the images folder and then create and explore that picture in the main method. If the picture is very large (for instance, one from a digital camera), you can scale it using the scale method in the Picture class. For example, you can make a new picture (smallMyPicture.jpg in the images folder) one-fourth the size of the original (myPicture.jpg) using: Picture p = new Picture("myPicture.jpg"); Picture smallP = p.scale(0.25,0.25); smallP.write("smallMyPicture.jpg");

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Machine Learning And Knowledge Discovery In Databases European Conference Ecml Pkdd 2014 Nancy France September 15 19 2014 Proceedings Part 2 Lnai 8725

Authors: Toon Calders ,Floriana Esposito ,Eyke Hullermeier ,Rosa Meo

2014th Edition

3662448505, 978-3662448502

More Books

Students also viewed these Databases questions

Question

what are the provisions in the absence of Partnership Deed?

Answered: 1 week ago

Question

1. What is called precipitation?

Answered: 1 week ago

Question

1.what is dew ?

Answered: 1 week ago