Programming Resources
For Fun and Learning
Charles Cusack
Computer Science
Hope College
main

Python
C++
JAVA
PHP
SQL
Alice

ScatterPlot


Description


Description

Scatter Plot Exercise

  1. Fork/Checkout ScatterPlot-Unfinished from GIT (URL is https://bitbucket.org/ferzle/scatterplotunfinished).
  2. Run the program. It should pop up a window with about 100 small circles of various colors.
  3. In the ColorderPointUtil class, implement writeList. Take a look at the following examples and/or your textbook to help you choose the class(es) to use.
  4. Test writeList by running the program and trying File-->Save.... Save the file on the desktop and then open it with a text editor to see if it looks correct.
  5. Still in ColorderPointUtil, implement stringToPoint and readList.
  6. Test the previous two methods by runing the program and using File-->Open...". Open the list you saved a few steps ago.
  7. In ScatterPlot, add a new menu item under File called New... that replaces the current points with a new set of points by calling generateRandomList.
  8. Answer the following questions
    1. How many different ways do you think there are to implement the read and write methods?
    2. Can you improve the implementation of toString in ColoredPoint?
    3. Why are the read/write methods in ColoredPointUtil? Can't they just be part of ColoredPoint? (Hint: As with many questions in computer science, there are several options, with each having advantages and disadvantages).