<< Chapter < Page Chapter >> Page >
  • How to design and implement an algorithm that will transform Prob02a.jpg and Prob02b.jpg into the image shown in Figure 2 .
  • How to flip an image around its center line.
  • How to crop an image.
  • How to copy one image onto another image.
Listing 2 - Write the Java application described below.

/*File Prob02 Copyright 2012 R.G.Baldwin

Write a program named Prob02 that uses the class definition shown below and Ericson's media libraryalong with the image files named Prob02a.jpg and Prob02b.jpg to produce the graphic output image shown in Figure 2 below.

Click Prob02.java to download a Java source file containing the solution to this program.

In addition to the output image, your program must display your name and the other text shownbelow on the command-line screen:

Display your name here. Picture, filename Prob02a.jpg height 118 width 100Picture, filename Prob02b.jpg height 240 width 320 Picture, filename None height 101 width 77*********************************************************/ public class Prob02{//DO NOT MODIFY THE CODE IN THIS CLASS DEFINITION. public static void main(String[]args){ Picture[]pictures = new Prob02Runner().run(); System.out.println(pictures[0]); System.out.println(pictures[1]); System.out.println(pictures[2]); }//end main method}//end class Prob02 //End program specifications.

Figure 2 - Required output image for Prob02.

Missing image

Program 3

Discussion

The following is a non-exhaustive list of concepts that you need to understand along with knowledge and skills that you need to possess in order tosuccessfully write this program and/or understand the given solution in Prob03.java . Some of these items are general in nature and some are specific to the use of Ericson's multimedia library. I won't repeat theitems that were listed with the programs in Practice Group 1 or earlier programs in this practice group. Instead, Iwill concentrate on new concepts, knowledge, and skills not included in previous lists.

Listing 3 - Write the Java application described below.

/*File Prob03 Copyright 2012 R.G.Baldwin

Write a program named Prob03 that uses the class definition shown below and Ericson's media libraryalong with the image files named Prob03a.bmp , Prob03b.bmp , Prob03c.bmp , and Prob03d.jpg to produce the graphic output image shown in Figure 3 below.

Click Prob03.java to download a Java source file containing the solution to this program.

In addition to the output, your program must display your name and the other text shownbelow on the command-line screen:

Display your name here. Picture, filename None height 256 width 344*********************************************************/ public class Prob03{//DO NOT MODIFY THE CODE IN THIS CLASS DEFINITION. public static void main(String[]args){ Prob03Runner obj = new Prob03Runner();obj.run(); }//end main}//end class Prob03 //End program specifications.

Get Jobilize Job Search Mobile App in your pocket Now!

Get it on Google Play Download on the App Store Now




Source:  OpenStax, Object-oriented programming (oop) with java. OpenStax CNX. Jun 29, 2016 Download for free at https://legacy.cnx.org/content/col11441/1.201
Google Play and the Google Play logo are trademarks of Google Inc.

Notification Switch

Would you like to follow the 'Object-oriented programming (oop) with java' conversation and receive update notifications?

Ask