Lab - Interfaces
Okay, just follow along, questions will be denoted with a
- Make some appropriate subdirectory for this lab and go there
- Copy needed files from ~kschmidt/public_html/CS265/Labs/Interfaces/ to your lab
Q 1 Describe what is meant by each of the
- Hide implementation details
- Choose a small orthogonal set of primitives
- Don't reach behind the user's back
- Do the same thing the same way everywhere
Q 2 What are the problems w/the first
implementation in C (Labs/Interfaces/csvgetline1.c)?
Q 3 What things were improved upon in the
first revision in C?
Q 4 What problems does the first revision
(Labs/Interfaces/csvgetline2.c) still have? Can you parse 2
different CSV files at the same time? Explain.
Q 5 Does the C++ implementation solve these
problems? What issues still remain?
Q 6 Does the interface for the C++
implementation adhere to our guidelines for a good i/f, from lecture?
Q 7 Implement a Java version of the CSV
library, and test:
- Provide a class called Csv that has the same functionality
as the C++ version (same i/f). Place it in a file called
Csv.java (do not use a CSV class that is already
- Provide a good test suite in a file called test.csv. Read
the specifications, make sure you've covered all possibilities
- Also provide a main method (a test driver) in the
same class, Csv, that reads test.csv, and outputs
something you can easily check for correctness (this might include the #
of fields per line).
- Submit these files with your lab
Some specifications for what a CSV is: