%Dan *******.
%Feb, 24.04
%Pay Slip.
%Activity 4 Assignment.
%This program takes your name
%money you make an hour and makes your pay slip.
var name, bank, today:string
var hour, overtime, number, worked:real
%calculation var's
var Income_tax, pension, empl_cont, elployer_cont, tax:real
%just to change the colour
colour (red)
%the 'enter' thingy
put "":3,"################### ENTER INFORMATION IN THIS SECTION ###################"
put "":8,"****** Dogs Breakfast Construction Payrool Program***********"
%starting message
color (green)
put "Hello"
put "what is your name?"..
get name:*
put "thankyou ",name,"."
put " "
put "how much money do you make in one hour? " ..
get hour
put "How many hours did you work "..
get worked
put " "
put "How many hours of overtime did you work??(if none just put '0') "..
get overtime
put " "
put "what is your Enployee number? "..
get number
put " "
put "what bank will you be putting the money into? "..
get bank:*
put " "
put "Please wait wail the computer processes your stub :)."
delay(300)
cls
%processing
put "# # # # # # #"
delay(500)
put " "
delay(500)
put " # # # # #"
delay(500)
put " "
delay(500)
put " # # # #"
delay(500)
put " "
delay(500)
put " # # # # #"
delay(500)
put " "
delay(500)
put "# # # # # # #"
delay(350)
cls
%second processing
put "# # # # # # #"
delay(500)
put " "
delay(500)
put "# # # # #"
delay(500)
put " "
delay(500)
put "# # # #"
delay(500)
put " "
delay(500)
put "# # # # #"
delay(500)
put " "
delay(500)
put "# # # # # # #"
delay(350)
cls
put "############### PREPARING TO PRINT YOUR PAYSLIP ######################"
delay(1200)
put "_____________--------------______________------------____________----------"
delay (1100)
put "-------------______________--------------_____________-----------__________"
delay (1000)
put "_____________--------------______________------------____________----------"
delay(500)
put "FIN."
delay (1500)
cls
%out put for stub
date (today)
%main calculations
const pay:=hour*worked
const otrate:=hour*1.5
const otpay:=otrate*overtime
const Gross:=otpay+pay
Income_tax:=Gross*0.27
pension:=Gross*0.003
const EI:=Gross*0.028
const CPP:=Gross*0.025
const Total:=Gross-EI
const total:=Total*0.27
const emp_EI:=1.4*EI
const emp_ben:=0.03*Gross
const emp_pen:=1.2*pension
const total_emp:=emp_EI+emp_ben+emp_ben
const net:=Gross-EI
const ne_t:=net*.27
const net2:=Gross-ne_t
const net3:=net2-EI-CPP
%out put, final
put " "
put "":6, "Elployee Payroll Slip":10,"":7,today
put"********************************************************************************"
put "":3, "Company Name: Dogs Breakfast Construction"
put " "
put " "
put "":6,"Employee: ",name,"":9,"Regular Hours: ", worked
put "":3,"Employee number: ", number,"":13,"Overtime Hours: ", overtime
put "Hourly Rate of pay: $", hour, "":12, "OT Rate of pay: $", otrate
put "":7,"Regular pay: $", pay,"":14, "Overtime pay: $", otpay
put" "
put "":3,"Employee Deductions", "":10,"Employer Contributions"
put "********************************************************************************"
put "":7, "Gross Pay: $", Gross
put "":3, "CPP Deduction: $", CPP,"":25, "Employer CPP: $", CPP
put "":5, "EI Dudction: $", EI, "":24, "Employer EI: $", 1.4*EI
put "":6, "Income Tax: $", Income_tax,"":19,"Employer benfits: $", 0.03*Gross
put "":4, "Pension Plan: $", pension,"":19, "Employer pension: $",1.2*pension
put "":0, "Total Deductions: $", total:0:2,"":2, "Total Employer Contributions: $", total_emp
put "********************************************************************************"
put "":9, "Net pay: $","":0, net3:0:2
put "":23, "Employers bank: Gotham City Bank"
put "":18, "Employers Account Number: 329596031"
put""
put "":20, "Direct Deposited to: ", bank
|