18 Capstone
After reading lesson 18, you will be able to:
- Incorporate method overloading and method overriding in an application
- Understand how to use polymorphism in an application
- Implement the comparable interface to compare objects in an application
The capstone for this unit concentrates on the learning objectives from lessons 13-17 but also includes everything we have learned so far in this book. The lesson starts with a set of business requirements. Based on these requirements, I will walk through the steps to complete an application. The business problem we are going to address is providing a report of upcoming projects for a general contracting business. A general contractor is hired for various type of projects from building a house to minor repairs. For this application, the contractor wants to keep track of the employees working on a project, the project customer’s name and address, and the start and end date for the project.
The application must be able to:
- Create a project with a start date, end date, customer name, address of the project, description, estimated cost, overhead percentage for the contractor, and a list of workers
- Print out the list of projects including the project address location
- Compare two projects and determine which project must be done first based on the start date
This is a small company that hires the following types of workers:
- Electrician
- Plumber
- Carpenter