<< Chapter < Page Chapter >> Page >

What's next?

In the next module, I will teach you how to invert images and how to display images using Ericson's PictureExplorer object.

While not a requirement of the course, you can select the following links to view optional online video lectures on the material in thismodule.

Miscellaneous

This section contains a variety of miscellaneous information.

Housekeeping material
  • Module name: Java OOP: Creating and Manipulating Turtles and Pictures in a World Object
  • File: Java3002.htm
  • Published: 07/26/12
Disclaimers:

Financial : Although the Connexions site makes it possible for you to download a PDF file for thismodule at no charge, and also makes it possible for you to purchase a pre-printed version of the PDF file, you should beaware that some of the HTML elements in this module may not translate well into PDF.

I also want you to know that, I receive no financial compensation from the Connexions website even if you purchase the PDF version of the module.

In the past, unknown individuals have misappropriated copies of my modules from cnx.org, converted them to Kindle books, andplaced them for sale on Amazon.com showing me as the author. I receive no compensation for those sales and don't know who doesreceive compensation. If you purchase such a book, please be aware that it is a bootleg copy of a module that is freelyavailable on cnx.org.

Affiliation : I am a professor of Computer Information Technology at Austin Community College in Austin, TX.

Complete program listing

A complete listing of the program discussed in this module is shown in Listing 9 below.

Listing 9 . Source code for Prob01 .
/*File Prob01 Copyright 2008 R.G.Baldwin Command-line outputjavac 1.6.0_14 java version "1.6.0_14"Java(TM) SE Runtime Environment (build 1.6.0_14-b08)Java HotSpot(TM) Client VM (build 14.0-b16, mixed mode, sharing)Dick Baldwin. A 300 by 274 world with 2 turtles in it.joe turtle at 44, 143 heading -135.0. sue turtle at 250, 237 heading 0.0.*********************************************************/ import java.awt.Color;public class Prob01{//Driver class public static void main(String[]args){ Prob01Runner obj = new Prob01Runner();obj.run(); System.out.println(obj.getMars());System.out.println(obj.getJoe()); System.out.println(obj.getSue());}//end main }//end class Prob01//*******************************************************/ class Prob01Runner{//Instantiate the World and Turtle objects. private World mars = new World(300,274);private Turtle joe = new Turtle(mars); private Turtle sue = new Turtle(mars);public Prob01Runner(){//constructor System.out.println("Dick Baldwin.");}//end constructor //----------------------------------------------------////Accessor methods public Turtle getJoe(){return joe;}public Turtle getSue(){return sue;} public World getMars(){return mars;}//----------------------------------------------------// //This method is where the action is.public void run(){ //Replace the default all-white picture with another// picture. mars.setPicture(new Picture("Prob01.jpg"));mars.getPicture().addMessage( "Dick Baldwin",10,20);//Manipulate the turtle named joe. joe.setName("joe");joe.setBodyColor(Color.RED); joe.setShellColor(Color.BLUE);joe.setPenColor(Color.YELLOW); joe.setPenWidth(3);joe.forward(); joe.turn(-135);joe.setPenColor(Color.BLUE); joe.forward(150);//Manipulate the turtle named sue sue.setName("sue");sue.setPenWidth(2); sue.setPenColor(Color.RED);sue.moveTo(183,170); sue.setPenDown(false);sue.moveTo(216,203); sue.setPenDown(true);sue.moveTo(250,237); }//end run method}//end class Prob01Runner

-end-

Questions & Answers

what is biology
Hajah Reply
the study of living organisms and their interactions with one another and their environments
AI-Robot
what is biology
Victoria Reply
HOW CAN MAN ORGAN FUNCTION
Alfred Reply
the diagram of the digestive system
Assiatu Reply
allimentary cannel
Ogenrwot
How does twins formed
William Reply
They formed in two ways first when one sperm and one egg are splited by mitosis or two sperm and two eggs join together
Oluwatobi
what is genetics
Josephine Reply
Genetics is the study of heredity
Misack
how does twins formed?
Misack
What is manual
Hassan Reply
discuss biological phenomenon and provide pieces of evidence to show that it was responsible for the formation of eukaryotic organelles
Joseph Reply
what is biology
Yousuf Reply
the study of living organisms and their interactions with one another and their environment.
Wine
discuss the biological phenomenon and provide pieces of evidence to show that it was responsible for the formation of eukaryotic organelles in an essay form
Joseph Reply
what is the blood cells
Shaker Reply
list any five characteristics of the blood cells
Shaker
lack electricity and its more savely than electronic microscope because its naturally by using of light
Abdullahi Reply
advantage of electronic microscope is easily and clearly while disadvantage is dangerous because its electronic. advantage of light microscope is savely and naturally by sun while disadvantage is not easily,means its not sharp and not clear
Abdullahi
cell theory state that every organisms composed of one or more cell,cell is the basic unit of life
Abdullahi
is like gone fail us
DENG
cells is the basic structure and functions of all living things
Ramadan
What is classification
ISCONT Reply
is organisms that are similar into groups called tara
Yamosa
in what situation (s) would be the use of a scanning electron microscope be ideal and why?
Kenna Reply
A scanning electron microscope (SEM) is ideal for situations requiring high-resolution imaging of surfaces. It is commonly used in materials science, biology, and geology to examine the topography and composition of samples at a nanoscale level. SEM is particularly useful for studying fine details,
Hilary
cell is the building block of life.
Condoleezza Reply
Got questions? Join the online conversation and get instant answers!
Jobilize.com Reply

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