In our last labs we have been manipulating real life weather data from. Our next task is to see how much simpler this can be if we employ an Object Oriented approach. We’re going to modify Lab # 3 to use an array of Weather objects instead of multi-dimensional arrays.
1. Define a Weather class. What data members will it require? What functions and methods will it use. (It should include all the sort of data we had in Lab 3.)
2. Build a user interface, what sorts of things might the user want to do with the data? (At the very least, it should do everything your program did in Lab 3.)
3. What good is a program if we can’t save the information! Use the code in the class SimpleWriter to store the information on a text file.
4. What if the daily data was provided in a text file? Write a class that loads a month’s worth of temperature data from a text file. Each temperature is separated by a ‘,’. Use the code in Simple Reader and StringTokenizerExample to read the data from a file stored in your hard drive!
What are the differences between working with multi-dimensional arrays and objects. Be prepared to discuss advantages and disadvantages.
Also want new insights into encapsulation do we have after this lab?