You need to add new functions, but before you can add any, you need to convert your current one-chart RAPTOR flow, and your one-module pseudocode program, over into something that uses modules as logically separate subroutines or subprograms.

The plan for this module asks you to make improvements to your program from the previous module. You will be required to redesign and restructure your program so it is clearer, easier for the programmer to understand, and easier to maintain. Be sure to update the comments in your RAPTOR program to show where you've modified it and what youve done to it.

Converting "In-line Modules' to Subprograms

Let's take that Payroll program we put together for Module 2, and make some improvements to it. Some of those improvements are to redesign and restructure it so that it is clearer, easier for the programmer to understand, and easier to maintain. When that is done, we can then add functionality to it, giving the users (our customers!) more powerful payroll processing tools.

We'll do this all in RAPTOR (later you will convert that RAPTOR to strong pseudocode as a separate assignment).

Tasks for this week:

  • Copy your RAPTOR program to a new file, with a name.
  • Identify the section of the flowchart that is the "inner loop" or block that inputs the payroll data, processes it, and writes the check. Separate this into three sections (one for each major activity). In your main program, replace these flows with CALL statements.

So, your resulting program should look something like:

  • there is an "outer" flow (input the company-wide payroll rate information; initialize variables; etc.), then there's a loop that:
    • prompts for an employee ID number, and if positive, it
    • CALL input_employee_payroll_data
    • CALL calculate _paycheck
    • CALL print_paycheck
  • and when there's no more employees to write checks for, it prints a report that says how many employees it wrote checks for, the total amounts of the gross pay and withholding amounts,
  • and then stops.

RAPTOR does not provide arguments or parameters. In reality, the only way you can do this "passing" is to pick variable names wisely, and write the subroutines (subcharts, as RAPTOR calls them) to use the right names the right ways.

As you work on this assignment, think about what other sorts of functions or tasks a payroll department user might want to have this program help them perform. Does it become easier to add those functions now that you're using subroutines?

Academic Honesty!
It is not our intention to break the school's academic policy. Posted solutions are meant to be used as a reference and should not be submitted as is. We are not held liable for any misuse of the solutions. Please see the frequently asked questions page for further questions and inquiries.
Kindly complete the form. Please provide a valid email address and we will get back to you within 24 hours. Payment is through PayPal, Buy me a Coffee or Cryptocurrency. We are a nonprofit organization however we need funds to keep this organization operating and to be able to complete our research and development projects.