Some Final Exam Notes
Remember that the final exam will be held on Thursday, December 12 8 AM to 10 AM.
It will be held in our regular classroom, and it must be taken in person.
You will be asked to provide your Temple ID number, a 9-digit number and your section number (1 - 5). Please have these handy, and do not forget to bring pencils and scrap paper.
You may bring one 8.5x11" note sheet with handwritten notes only, and you'll turn this in along with your exam. You will receive up to 2 bonus points if your note sheet contains your name and correct TUID and section number.
The exam is cumulative. Be sure to understand what was done in the two midterms. You should also be sure to know everything in the set of notes on methods and references. Any of the material from the first two midterms (and the practice problems posted for them) could be on the exam. The material not covered by the 2nd midterm that you should be sure to know is:
- What you've done in Assignment 10. You'll need to be able
to implement a simple class and a class that inherits from
another.
- Recursion. Be able to solve problems no more complicated than the ones we've done in class.
- Basics of polymorphism. (Be able to do problems similar to the Lamb, Ham, etc. example)
- Exceptions. Be able to follow the very basic control flow
(e.g., what happens when an exception occurs in the middle of a try
block? What happens if no exception occurs?), but you will not have
to write any code that must be put in try-catch blocks.
- You do not have to reproduce the code for sorting or binary
search, but you should be able to trace the steps taken by the
algorithms we've covered. Know the very basics of determining the complexity of an
algorithm (e.g., sequential search is O(n), binary search is O(log
n)) and what Big-O
means (it's the approximate number of steps that an algorithm will
take in the worst case when the input is of size n).
- You will not be asked:
- details about packages
- wrapper classes
- interfaces
- details about ArrayList, though you may find it convenient to use it in your answers to the programming questions
more classes
Here are a few more sample problems on classes. Many are just like ones from midterm 2, but with a little bit more detail.
- What's the difference between static and non-static methods?
- Create a Rectangle class. Rectangles have a location,
which is the x,y coordinate of its lower left-hand side. They also
have a length and width. Include a constructor, accessor and mutator
methods, a getArea() method,
and equals().
- Create a Flash Card class. Flash Cards have a Question and an
Answer, each of which are Strings. Your class should include a
constructor, toString()
and equals() methods. Write
a main() method that creates an array of
three Flash Cards, and prints each of them.
- Create an address class. Addresses have a street number, a
street, a city, state, and zip code. Your class should include a
constructor, toString()
and equals() methods.
- Create a CommercialAddress class. CommercialAddresses are Addresses (see previous) that also have a CompanyName. Provide a constructor for CommercialAddress, which does what Address' constructor does, but also initializes CompanyName.
If we'd like to generate a String representation of a CommercialAddress, but do not intend to include the CompanyName in the resulting String, must we add any additional code to the CommercialAddress class? Why or why not?
- Create a LineSegment class. A line
segment should contain two Points. Add a constructor and toString
methods. add a getSlope() method.