Site icon TestingDocs.com

Weekly Gross Pay Raptor Flowchart

Problem

Calculate the weekly gross pay for an employee using a  Raptor Flowchart. Based on the below information.

Overtime rule: If the employee works for more than 30 hrs/week, the company pays 20% extra on all the hours worked overtime.

IPO chart

Consider modeling an IPO chart for the flowchart before the flowchart design. Think about the input to the flowchart, processing statements, and the output of the flowchart. IPO chart is a handy tool to visualize in a tabular format.

 

Input Process Output
Input to the flowchart. Computations that are done in the flowchart. Output displayed by the flowchart

Weekly Gross Pay Flowchart

 

Pseudocode

START
//Declare variables used in the flowchart
    hoursWorked =0;
    ratePerHour =0;
    grossPay =0;
    overTime ="";

//Take input from the user    
    PROMPT ="Enter weekly hours worked :=";
    INPUT hoursWorked
    PROMPT ="Enter rate per hour := $";
    INPUT ratePerHour;

//overtime logic calculations	
  IF (hoursWorked>30)
         {
            overTime ="Yes";
            grossPay =30*ratePerHour+(hoursWorked-30)*1.2*ratePerHour; 
// 20 % extra for overtime 1+ 20/100 = 1.2
         }
    ELSE
         {
            overTime ="No";
            grossPay =hoursWorked*ratePerHour;
         }
     
// Output		 
    PRINT ("Hours Worked :="+hoursWorked);
    PRINT ("Rate per hour := $"+ratePerHour);
    PRINT ("OverTime ?="+overTime);
    PRINT ("Weekly gross pay := $"+grossPay);
END

 

Output

Let’s run the flowchart with sample test cases to verify that it’s working as intended. If you find that the flowchart is not working as intended in the testing, we may need to verify and debug the flowchart.

Debugging a flowchart: https://www.testingdocs.com/debugging-a-raptor-flowchart/

 

 

Hours Worked :=45
Rate per hour := $10
OverTime ?=Yes
Weekly gross pay := $480
—-Run complete. 16 symbols evaluated.—-

 

More Flowchart Examples

https://www.testingdocs.com/raptor-flowchart-examples/

Raptor Tutorial

Raptor Tutorials on this website can be found at:

https://www.testingdocs.com/raptor-a-flowchart-tool/

RAPTOR official website: https://raptor.martincarlisle.com/

Exit mobile version