This recipe builds on the previous one. The previous recipe placed all the codes into one big method. This is fine for the first experiment, but when things get more complicated, you'll lose track of what goes where.
This recipe brings structure into the code and shows how to graph multiple points without repeating yourself.
Make sure you at least glanced over the previous recipe. You'll need it here.
Create a new, blank
Recipe2 class, set it as the document class, and copy and paste the code inside the
Recipe1 constructor placed inside it. To be sure, run the class and verify that everything looks the same as in the previous recipe.
We will tackle the generalization of the code in a few steps. If ...