In the previous module, you wrote a simple RAPTOR program to let you input one employee's data and compute some basic payroll information. Now, expand on that program. Using RAPTOR, make use of its built-in SELECTION and LOOP structures to let you flowchart the program and then run it.
The second part of your payroll program (withholding) will help a small business compute its weekly payroll, print out the information for each paycheck, and keep running totals on gross payroll, as well as various withholding funds such as taxes, social security, and pension.
This Payroll Program with Withholding will help a small business compute its weekly payroll, print out the information for each paycheck, and keep running totals on gross payroll as well as various withholding funds - taxes, social security, and pension.
In order to do that, it will have to create some variables for those cumulative or running sums, and each time it inputs, computes and outputs an individual employee's paycheck, it will need to add those values to these accumulator variables.
The wage rates, tax rates, wages, etc., are all in a currency of your choice - just be consistent with the symbol you use, the prompts you give the user, etc. But all computations, inputs, and outputs will be in that base currency. No "currency exchange" needed here!
"What kind of numbers?" For a start, use floating point numbers (reals).
Chapter two introduces the concept of a module as a stretch of code that you name, define its work, and then CALL it to use it when you need to. You may find this module approach makes designing the program easier. Even without it, you'll see that:
There is an "outer" flow (input the company-wide payroll rate information; initialize variables; etc.), then there's a loop that:
The lazy/efficient programmer might study that indented bullet list, convince themselves as to whether it is or is not a correct way to do this program, and use it as a start on a pseudocode design for the program!
But, we're doing this in RAPTOR pseudocode is optional, and if it helps you see what you have to do, then youre welcome to use it!
Input data:
Output data: