<< 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

Ayele, K., 2003. Introductory Economics, 3rd ed., Addis Ababa.
Widad Reply
can you send the book attached ?
Ariel
?
Ariel
What is economics
Widad Reply
the study of how humans make choices under conditions of scarcity
AI-Robot
U(x,y) = (x×y)1/2 find mu of x for y
Desalegn Reply
U(x,y) = (x×y)1/2 find mu of x for y
Desalegn
what is ecnomics
Jan Reply
this is the study of how the society manages it's scarce resources
Belonwu
what is macroeconomic
John Reply
macroeconomic is the branch of economics which studies actions, scale, activities and behaviour of the aggregate economy as a whole.
husaini
etc
husaini
difference between firm and industry
husaini Reply
what's the difference between a firm and an industry
Abdul
firm is the unit which transform inputs to output where as industry contain combination of firms with similar production 😅😅
Abdulraufu
Suppose the demand function that a firm faces shifted from Qd  120 3P to Qd  90  3P and the supply function has shifted from QS  20  2P to QS 10  2P . a) Find the effect of this change on price and quantity. b) Which of the changes in demand and supply is higher?
Toofiq Reply
explain standard reason why economic is a science
innocent Reply
factors influencing supply
Petrus Reply
what is economic.
Milan Reply
scares means__________________ends resources. unlimited
Jan
economics is a science that studies human behaviour as a relationship b/w ends and scares means which have alternative uses
Jan
calculate the profit maximizing for demand and supply
Zarshad Reply
Why qualify 28 supplies
Milan
what are explicit costs
Nomsa Reply
out-of-pocket costs for a firm, for example, payments for wages and salaries, rent, or materials
AI-Robot
concepts of supply in microeconomics
David Reply
economic overview notes
Amahle Reply
identify a demand and a supply curve
Salome Reply
i don't know
Parul
there's a difference
Aryan
Demand curve shows that how supply and others conditions affect on demand of a particular thing and what percent demand increase whith increase of supply of goods
Israr
Hi Sir please how do u calculate Cross elastic demand and income elastic demand?
Abari
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