90 likes | 151 Views
Pseudocode Demo for Payroll.c. Flowchart, Hierarchy Chart and Pseudocode. Flowchart for payroll.c main(). Calculate Wages. A. Begin Payroll. Employee # Not 0 ?. Display Total Wages. No. Open Output File. Yes. Input Payrate & Hours Worked. End Payroll. Initialize
E N D
Pseudocode Demofor Payroll.c Flowchart, Hierarchy Chart and Pseudocode
Flowchart for payroll.c main() Calculate Wages A Begin Payroll Employee # Not 0 ? Display Total Wages No Open Output File Yes Input Payrate & Hours Worked End Payroll Initialize Total = 0 Increment Total Wages Clear Screen Get Employee Number Output Employee Data Input Next Employee # A
Flowchart for payroll.c calc_wages() Begin calc_wages Pass in Payrate and Hours Overtime ? Yes No Calc Wages with Overtime Calc Wages without Overtime End calc_wages
Hierarchy Chart for payroll.c main( ) calc_wages( ) A hierarchy chart shows what functions other functions call.
Flowchart Symbols input/output symbol processing symbol start or stop symbol connector symbols module (subroutine or function) symbol decision 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