pg104-32 - begin net:= gross-withold writeln('Your gross...

Info iconThis preview shows pages 1–4. Sign up to view the full content.

View Full Document Right Arrow Icon
Sheet1 Page 1 program WorkersPay const payrate= 9.63 sstax= .06 fitax= .14 sitax= .05 uniondues= 6 dependdues= 10 overtimerate= 1.5 vars hrs, grosspay, netpay, dependents, withholdings, socialdeduc, federaldeduc, statededuc, uniondeduc, dependdeduc := real Procedure GetData(var hrs, depend: real) begin writeln('Please enter how many hours you worked this week, then press return:') readln('hrs') writeln('Please enter your number of dependents, then press return:') readln('dependents') end Procedure CalcPay(hrs, depend: real begin If hrs<=40 then gross:= hrs*payrate withhold:= (gross*sstax)+(gross*fitax)+(gross*sitax)+uniondues else {hrs>40} gross:= hrs*(payrate*overtimerate) social:=gross*sstax federal:=gross*fitax state:=gross*sitax union:= uniondues withhold:= social+federdal+state+union If depend>=3 then
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Sheet1 Page 2 dependout:= dependues withold:=social+federdal+state+union+dependdues else {depend<3} withold:=social+federdal+state+uniondues end Procedure OutputPay(gross, withold, social, federal,state, union, dependout:real
Background image of page 2
Background image of page 3

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Background image of page 4
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: begin net:= gross-withold writeln('Your gross pay for the week is: ',gross) writeln('Your social security tax deduction is: ',social) writeln('Your federal income tax deduction is: ',federal) writeln('Your state income tax deduction is: ',state) writeln('Your union dues deduction is: ',union) writeln('Your dependents deduction is: ',dependout) writeln('So, your total withholdings are: ',withold) writeln('Finally, your net pay for the week is: ',net) end begin {program} GetData(hrs,dependents) CalcPay(hrs, dependents, grosspay, withholdings, socialdeduc, federaldeduc, statededuc, uniondeduc, dependdeduc) OutputPay(grosspay, withholdings, socialdeduc, federaldeduc, statededuc, uniondeduc, dependdeduc, netpay) end. Sheet1 Page 3 var gross, withhold, social, federal, state. union, dependout: real) Sheet1 Page 4 var net:real)...
View Full Document

This note was uploaded on 03/27/2008 for the course CPSC 110 taught by Professor Logan during the Spring '07 term at Texas A&M.

Page1 / 4

pg104-32 - begin net:= gross-withold writeln('Your gross...

This preview shows document pages 1 - 4. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online