- Open Processing and copy the code from Thingies.pde into Processing.
- Save your programs as "ThingiesProgram" or just "Thingies" but NOT "Thingy."
- Open a new tab in processing and name the file "Thingy.java." Copy in the code for the Thingy class.
- Run the program. You should get an error message that says
The field Thingy.myX is not visible
because the client code insetup()
is trying to accessprivate
member variables. - Fix the program by
- finishing the four setter and getter functions in
Thingy.java
- rewriting the client code in
setup()
to use the four setter and getter functions
- The finished program should print
Distance between bob and mary is 56.568542
- Show your teacher the finished program.