A good friend of yours owns a small company that produces a tool the helps disabled individuals open jars and containers. Rather than buy a time clock mechanism, he would like to put an old computer on the warehouse floor that could be used as the time clock and help them manage materials, shipments, etc. Your friend was able to find an inexpensive application to keep track of each employee's hours. However, this application did not contain the code to determine how much each employee needs to get paid at the end of the week. Therefore, he has come to you for some help. He would like you to develop a small application that would accept the total number of hours worked and the hourly rate for his employees. The program would then calculate the total pay. He would like this program to keep asking him for employee hours and rate until he enters the word No when asked to continue. The output would be net pay. Net pay is derived from the following equation:
Gross Pay = Hours Worked * Pay Rate
Deductions = Gross Pay * 0.35
Net Pay = Gross Pay - Deductions
Step 1: Analyze the problem. In the table below list the inputs, outputs and a one sentence description of the problem.
Input:
|
|
Problem Statement:
|
|
Output:
|
|
Step 2:What variables are you going to need and what will be their datatype. (The number of spaces in this table does not necessarily mean these are the only variables\constants. This problem can be solved a number of different ways.)
Variable\Constant Name
|
Datatype
|
|
|
|
|
|
|
|
|
|
|
Step 3:Create a 30,000 view outline of the problem. How would you break this problem into numerous smaller units? Place your outline below:
Step 4:Construct your class DeterminePay.
Step 4:In looking at your overall outline of the problem. Break apart your larger portions into smaller ones. Place your revised outline below:
Lab 12.2 - Raptor
In this portion of the lab you will take the pseudocode you developed above and test it using Raptor.
Step 1: Code in Raptor. Open up Raptor and code this problem. Remember that in order to create a class you need to run Raptor in Object Oriented mode. Further you need to select UML.
Step 2: Test your program using the following data. At this point don't worry about getting your prices to display only 2 decimal places. We will learn how to do that later.
Hours Worked
|
Rate
|
Gross
|
Deductions
|
Net
|
37
|
15.75
|
$582.75
|
$203.96
|
$378.79
|
20
|
13.50
|
$270.00
|
$94.50
|
$175.50
|
15
|
11.95
|
$179.25
|
$62.74
|
$116.51
|
My output looked like the following:
Step 3: If your results match the test, then hand in your Raptor program and this lab. Otherwise go back over your Raptor program and correct any errors.