pseudocode demo for payroll.c flowchart, hierarchy chart and pseudocode
TRANSCRIPT
Pseudocode DemoPseudocode Demofor Payroll.cfor Payroll.c
Flowchart, Flowchart, Hierarchy ChartHierarchy Chartand Pseudocodeand Pseudocode
Flowchart for payroll.c main()Begin
Payroll
OpenOutput
File
InitializeTotal = 0
Clear ScreenGet Employee
Number
A
A
Employee# Not 0
?
Input Payrate& Hours Worked
CalculateWages
IncrementTotal Wages
Output Employee Data
Input NextEmployee #
DisplayTotal
Wages
EndPayroll
Yes
No
Flowchart for payroll.c calc_wages()
Begincalc_wages
Overtime?
Calc Wageswith
Overtime
Endcalc_wages
Calc Wageswithout
Overtime
Yes No
Pass inPayrate andHours
Hierarchy Chart for payroll.c
main( )
calc_wages( )
A hierarchy chart shows what functions other functions call.
Flowchart Symbols
input/outputsymbol
processingsymbol
start or stopsymbol
decisionsymbol
module(subroutine or function)
symbol
connectorsymbols
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