- Open Processing and copy the code from Doodads.pde into Processing.
- Save your programs as "DoodadsProgram" or just "Doodads" but NOT "Doodad."
- Open a new tab in processing and name the file "Doodad.java." Copy in the code for the Doodad class.
- Run the program. You should get an error message that says
The field Doodad.myNum is not visiblebecause the client code insetup()is trying to access aprivatemember variable. - Fix the program by
- finishing the two setter and getter functions in
Doodad.java - rewriting the client code in
setup()to use the two setter and getter functions
- The finished program should print
Sum is 5.859870195388794 - Show your teacher the finished program.