Professional Documents
Culture Documents
for Payroll.c
Flowchart,
Hierarchy Chart
and Pseudocode
Flowchart for payroll.c main()
A
Begin
Payroll Employee No Display
# Not 0 Total
?
Wages
Open Yes
Output
File Input Payrate End
& Hours Worked Payroll
Initialize Calculate
Total = 0 Wages
Increment
Clear Screen Total Wages
Get Employee
Number
Output
Employee Data
Input Next
Employee #
A
Flowchart for payroll.c calc_wages()
Begin Pass in
Payrate and
calc_wages Hours
Overtime
Yes ? No
End
calc_wages
Hierarchy Chart for payroll.c
main( )
calc_wages( )
module connector
decision symbols
symbol (subroutine or function)
symbol
Pseudocode for Payroll Program
begin main
open output file
initialize total and employee number to 0
clear screen
get employee number
while (employee number not 0)
input payrate and hours worked
<calculate wages>
increment total wages
output employee data
input next employee number
endwhile
display total wages
end main
begin calc_wages(payrate, hours worked)
if (hours worked > 40)
wages = (40 * payrate) + (hours worked - 40) * payrate * overtime multiplier
else
wages = hours worked * payrate
endif
return (wages)
end calc_wages