7 Capstone 1
In lessons 1 – 6, I introduced the NetBeans Integrated Development Environment (IDE), reviewed the concept of creating classes to represent real world objects, how to add data for each object, how to add methods for each object, and how to modify the data associated with a specific object.
This lesson is a capstone of these topics providing you with the opportunity to reinforce the skills learned. In this lesson, I will introduce a problem that is designed to include everything presented so far in the book.
In this lesson, I will walk through the process of creating a simple payroll application. Let’s start by thinking about the problem, what are we trying to accomplish? The program needs to create the weekly payroll for each employee. Sounds simple, but what about overtime? How about employees who are paid annually? First, it is important to gather the business requirements for our problem.
For this problem, I will act as the company owner. Here are the requirements for this assignment:
- The payroll report prints the employee first name, last name, and weekly earnings
- Hourly employees earn overtime for any hours greater than 40 in one week
- Overtime hours are paid at a rate of 1.5 times their regular hourly rate
- Salaried employees are paid their annual salary divided by 52 each week
Note:
Some years have 53 weeks in a year, but this program will keep it simple and use only 52 weeks.