CA 276 Green Team Group Projects
Green Team Home Project 1 Project 2 (you are here) Green Team Project 3 Green Team Project 4 (future)

Project 2 calculates an employees weekly net pay as described in the book.

For this project, Janey Hoff is the leader/recorder and Elizabeth Buie is the coder.

(Note: Janey dropped the class midway through this assignment. Her notes appear at the beginning of this page, and Elizabeth's additions appear at the end. Janey did a flow diagram, but as designer/coder Elizabeth did not look at it (except to make sure the link worked), and therefore does not know how well it matches the logic of the code. Elizabeth would have used GIF rather than PDF anyhow.)

The Product The Records (you are here)

Assignment

"Create a program that calculates an employee's weekly gross salary, tax withholding (which is 15% of gross pay), and net pay, based on the number of hours worked and hourly wage. Compute any hours over 40 as time-and-a-half. Use the appropriate decision structures to create the program. Display the weekly gross pay, tax withholding and net pay (p.251 of book)

In her day job, Janey works as a computer science teacher. She has learned a little bit about providing plans to the software team from Elizabeth. She will try to follow the outline already set up by Elizabeth in Project 1. The clearest way to state what a product must do — so that it can be designed, coded, and tested unambiguously — is to write the "shall" statements that the assignment contains. (It is also the best way to make sure the assignment is understood and to identify any questions about it.)

These requirements (also called "shall"s) consist of two kinds:

  • Explicit requirements are specifically contained in the assignment or the specification of what the product must do
  • Derived, or implicit, requirements are identified and defined (usually by the software team) to capture what is implied but not specifically stated by the explicit requirirements.

This assignment has six explicit requirements, and yields two derived requirements.

Requirements

Explicit requirements:

  1. The Pay Calculator shall use appropriate JavaScript control structures.
  2. Net Pay shall be calculated by multiplying the hours worked and the hourly wage.
  3. Time-and-a-half pay shall be calculated for any hours worked over 40 hours at the rate of 1.5 times the regular pay rate.
  4. Tax Withholding shall be calculated as 15% of Gross Pay.
  5. The Pay Calculator shall display Gross Pay, Tax Withholding, and Net Pay in textboxes.
  6. The Pay Calculator shall be stored in a filed named GrossPay.html.

Derived requirements:

  1. The Pay Calculator shall request the pay rate and hours worked from the user in a textbox (reason: have to get the information from the user in some format)
  2. The Pay Calculator shall provide a "Clear" button that erases the current contents of the field. (reason: The user has to have a way to start over.)

Flowchart (PDF) for program

These last two things we identified as necessary for the Pay Calculator to work correctly and be usable.

Team Process

On July 7 the team got together and set up a timeline on how the Group would handle Projects 2, 3,and 4. Since Elizabeth was on vacation from July 9, she turned over the role of leader to Janey for Project 2. As Janey will be on vacation for the following project, Elizabeth will accept the role of leader for Project 3.

On July 9 the team received the new assignment. As team leader, Janey began by outlining the program as shown above and creating a flow chart (PDF of Flowchart). She then emailed Elizabeth the plan for comment and implementation.

Elizabeth wrote, commented, and tested the code.

Documentation of Product

Description

[tbd]

Software Design

[tbd]


[Elizabeth's notes]

Software Design

The area on the left accepts input from the user, in terms of hours worked and wage paid per hour. It includes a "compute pay" button to do the calculations and a "start over" button to blank out the fields, should the user want to do that. The "hours" field receives focus when the page is first loaded and after every computation, so that the user does not have to click there explicitly to start a new computation. The tab order of these fields and buttons facilitates keyboard entry and control.

The function that computes the gross pay, tax, and net pay is in the <head> section. It multiplies by 1.5 any hours over 40, so that those hours receive time-and-a-half wages. It then computes gross pay by multiplying hours worked by the wage paid. It multiplies gross pay by 0.15 to get the tax, and it subtracts tax from gross pay to get net pay. It displays these three computed numbers in the text boxes to the right of the input area.