REM REM Date REM Instructor Name REM Assignment Chapter 1 Number 8 Page 30 REM REM Statement of problem : REM Analysis IPO. REM REM Data Requirements REM REM Constants REM REM Inputs REM REM Outputs pay roll stub. REM REM Variables REM REM Formulas REM REM Design REM REM Algorithm REM REM 1. create form with lprint statments REM 2. print form REM 3. REM 4. Etc. REM REM Implementation - here you begin to code. CLS Firstname$ = " " mname$ = " " lName$ = " " Address$ = " " City$ = " " State$ = " " Zip$ = " " ssn$ = " " HrsWk = 0 today$ = " " Fromdate$ = " " todate$ = " " checkno$ = " " reghr = 0 othr = 0 dthr = 0 REM input section READ wc, sdi, fica, sit, payrate DO UNTIL next$ = "-999" CLS FOR x = 1 TO 80 PRINT "*"; NEXT x PRINT "|"; TAB(80); "|" PRINT "|"; TAB(30); "Cheap Student Labor Main Menu"; TAB(80); "|" PRINT "|"; TAB(10); "1. Input Data"; TAB(50); "8.Pay Stub by SSN of Employee"; TAB(80); "|" PRINT "|"; TAB(10); "2. Print Edit Report"; TAB(50); "9. Under Const"; TAB(80); "|" PRINT "|"; TAB(10); "3. Display Edit Report"; TAB(50); "10. Under cvonst"; TAB(80); '"|" PRINT "|"; TAB(10); "4. Edit Data"; TAB(50); "11. Under construction"; TAB(80); "|" PRINT "|"; TAB(10); "5. Edit Ok, Post to Master"; TAB(50); "12. Underconstruction"; TAB(80); "|" PRINT "|"; TAB(10); "7. Display Payroll Stub"; TAB(50); "14. Under Const"; TAB(80); "|" PRINT FOR x = 1 TO 80 PRINT "*"; NEXT x INPUT "Enter your menu choice, 1,2, etc"; choice SELECT CASE choice CASE IS = 1 CLS OPEN "d:\cheaplab.txt" FOR APPEND AS #1 DO UNTIL next2$ = "-0" INPUT "Enter the current date mm/dd/yy"; today$ INPUT "Enter the beginning date of the pay period mm/dd/yy"; Fromdate$ INPUT "Enter the ending date of the pay period mm/dd/yy"; todate$ INPUT "Enter the check no:"; checkno$ INPUT "Enter the hours worked this pay period"; HrsWk INPUT "Enter the employee's ssn xxx-xx-xxxx"; ssn$ INPUT "Enter the employee's first name"; Firstname$ INPUT "Enter the employee's Middle initial with period"; mname$ INPUT "Enter the employee's last name"; lName$ INPUT "Enter the employee's address"; Address$ INPUT "Enter the employee's city"; City$ INPUT "Enter the employee's state XX"; State$ INPUT "Enter the employee's zip code"; Zip$ REM processing section IF HrsWk <= 40 THEN regpay = HrsWk * payrate reghr = HrsWk ELSEIF HrsWk <= 80 THEN regpay = 40 * payrate reghr = 40 otpay = (HrsWk - 40) * payrate * 1.5 othr = HrsWk - 40 ELSEIF HrsWk > 80 THEN regpay = 40 * payrate reghr = 40 otpay = 40 * payrate * 1.5 othr = 40 dtpay = (HrsWk - 80) * payrate * 2 dthr = HrsWk - 80 END IF grosspay = regpay + otpay + dtpay REM caculate the deductions wctax = wc * grosspay ficatax = fica * grosspay sitax = sit * grosspay sditax = sdi * grosspay netpay = grosspay - (sditax + sitax + ficatax + wctax) WRITE #1, today$, Fromdate$, todate$, checkno$, HrsWk, ssn$, Firstname$, mname$, lName$, Address$, City$, State$, Zip$, regpay, reghr, otpay, othr, dtpay, dthr, grosspay, netpay, wctax, ficatax, sditax, sitax INPUT "Enter -0 to quit, else touch anykey to enter another record"; next2$ LOOP CLOSE #1 CASE IS = 2 CASE IS = 3 CLS OPEN "d:\cheaplab.txt" FOR INPUT AS #1 FOR x = 1 TO 80 PRINT "*"; NEXT x PRINT "|"; TAB(5); "Date "; TAB(15); "From :"; TAB(25); "To "; TAB(35); "Ck No"; PRINT TAB(40); "Hrs Wk"; TAB(47); "SSN "; TAB(60); "Firstname"; TAB(80); PRINT "|"; TAB(5); "Init "; TAB(10); "Last Name :"; TAB(25); "Address"; TAB(45); "City"; PRINT TAB(60); "State"; TAB(66); "Zip "; TAB(80); FOR x = 1 TO 80 PRINT "-"; NEXT x DO WHILE NOT EOF(1) INPUT #1, today$, Fromdate$, todate$, checkno$, HrsWk, ssn$, Firstname$, mname$, lName$, Address$, City$, State$, Zip$, regpay, reghr, otpay, othr, dtpay, dthr, grosspay, netpay, wctax, ficatax, sditax, sitax PRINT "|"; TAB(5); today$; TAB(15); Fromdate$; TAB(25); todate$; TAB(35); checkno$; PRINT TAB(40); HrsWk; TAB(47); ssn$; TAB(60); Firstname$; TAB(80); PRINT "|"; TAB(5); mname$; TAB(10); lName$; TAB(25); Address$; TAB(45); City$; PRINT TAB(60); State$; TAB(66); Zip$; TAB(80); FOR x = 1 TO 80 PRINT "-"; NEXT x LOOP CLOSE #1 CASE IS = 4 CASE IS = 5 OPEN "d:\cheaplab.txt" FOR INPUT AS #1 OPEN "d:\cheapmas.txt" FOR APPEND AS #2 DO WHILE NOT EOF(1) INPUT #1, today$, Fromdate$, todate$, checkno$, HrsWk, ssn$, Firstname$, mname$, lName$, Address$, City$, State$, Zip$, regpay, reghr, otpay, othr, dtpay, dthr, grosspay, netpay, wctax, ficatax, sditax, sitax WRITE #2, today$, Fromdate$, todate$, checkno$, HrsWk, ssn$, Firstname$, mname$, lName$, Address$, City$, State$, Zip$, regpay, reghr, otpay, othr, dtpay, dthr, grosspay, netpay, wctax, ficatax, sditax, sitax LOOP CLOSE #1 CLOSE #2 KILL "d:\cheaplab.txt" REM output section CASE IS = 6 PRINT "Under construction" CASE IS = 7 CLS FOR x = 1 TO 80 PRINT "="; NEXT x PRINT "|"; PRINT TAB(30); "Cheap Student Labor"; PRINT TAB(60); "Number"; PRINT TAB(68); checkno$; PRINT TAB(80); "|" PRINT "|"; PRINT TAB(30); "Suisun Valley Road"; PRINT TAB(80); "|" PRINT "|"; PRINT TAB(27); "Suisun City, California"; PRINT TAB(60); "Date"; PRINT TAB(68); today$; PRINT TAB(80); "|" PRINT "|"; PRINT TAB(5); Firstname$; TAB(16); mname$; TAB(19); lName$; TAB(60); "Pay Period"; PRINT TAB(80); "|" PRINT "|"; PRINT TAB(5); Address$; TAB(60); "From Date"; TAB(70); "To Date"; TAB(80); "|" PRINT "|"; TAB(5); City$; TAB(16); ","; TAB(18); State$; TAB(21); Zip$; TAB(60); Fromdate$; PRINT TAB(70); todate$; TAB(80); "|" PRINT "|"; TAB(5); ssn$; TAB(80); "|" PRINT "|"; TAB(80); "|" PRINT "|"; TAB(80); "|" PRINT "|"; TAB(10); "Reg "; TAB(20); "OT "; TAB(30); "DT"; TAB(80); "|" PRINT "|"; "Hrs"; TAB(10); reghr; TAB(20); othr; TAB(30); dthr; TAB(80); "|" PRINT "|"; "Pay"; TAB(10); regpay; TAB(20); otpay; TAB(30); dtpay; TAB(80); "|" PRINT "|"; TAB(80); "|" PRINT "|"; TAB(10); "GrossPay"; TAB(20); "WC "; TAB(30); "SDI"; TAB(40); "FICA"; PRINT TAB(50); "Sit"; TAB(60); "NetPay"; TAB(70); "Count"; TAB(80); "|" PRINT "|"; "Current"; TAB(10); grosspay; TAB(20); wctax; TAB(30); sditax; PRINT TAB(40); ficatax; TAB(50); sitax; TAB(60); netpay; TAB(80); "|" PRINT "|"; "YTD"; TAB(10); grospayytd; TAB(20); wctaxytd; TAB(30); sditaxytd; PRINT TAB(40); ficataxytd; TAB(50); sitaxytd; TAB(60); netpayytd; TAB(70); counter; TAB(80); "|" FOR x = 1 TO 80 PRINT "="; NEXT x CASE IS = 8 CLS INPUT "Enter the employee SSN"; ssn2$ OPEN "D:\cheapmas.txt" FOR INPUT AS #1 DO WHILE NOT EOF(1) INPUT #1, today$, Fromdate$, todate$, checkno$, HrsWk, ssn$, Firstname$, mname$, lName$, Address$, City$, State$, Zip$, regpay, reghr, otpay, othr, dtpay, dthr, grosspay, netpay, wctax, ficatax, sditax, sitax IF ssn$ = ssn2$ THEN grosspayytd = grosspayytd + grosspay wctaxytd = wctaxytd + wctax ficataxytd = ficataxytd + ficatax sditaxytd = sditaxytd + sditax sitaxytd = sitaxytd + sitax netpayytd = netpayytd + netpay counter = counter + 1 END IF LOOP CLS FOR x = 1 TO 80 PRINT "="; NEXT x PRINT "|"; PRINT TAB(30); "Cheap Student Labor"; PRINT TAB(60); "Number"; PRINT TAB(68); checkno$; PRINT TAB(80); "|" PRINT "|"; PRINT TAB(30); "Suisun Valley Road"; PRINT TAB(80); "|" PRINT "|"; PRINT TAB(27); "Suisun City, California"; PRINT TAB(60); "Date"; PRINT TAB(68); today$; PRINT TAB(80); "|" PRINT "|"; PRINT TAB(5); Firstname$; TAB(16); mname$; TAB(19); lName$; TAB(60); "Pay Period"; PRINT TAB(80); "|" PRINT "|"; PRINT TAB(5); Address$; TAB(60); "From Date"; TAB(70); "To Date"; TAB(80); "|" PRINT "|"; TAB(5); City$; TAB(16); ","; TAB(18); State$; TAB(21); Zip$; TAB(60); Fromdate$; PRINT TAB(70); todate$; TAB(80); "|" PRINT "|"; TAB(5); ssn$; TAB(80); "|" PRINT "|"; TAB(80); "|" PRINT "|"; TAB(80); "|" PRINT "|"; TAB(10); "Reg "; TAB(20); "OT "; TAB(30); "DT"; TAB(80); "|" PRINT "|"; "Hrs"; TAB(10); reghr; TAB(20); othr; TAB(30); dthr; TAB(80); "|" PRINT "|"; "Pay"; TAB(10); regpay; TAB(20); otpay; TAB(30); dtpay; TAB(80); "|" PRINT "|"; TAB(80); "|" PRINT "|"; TAB(10); "GrossPay"; TAB(20); "WC "; TAB(30); "SDI"; TAB(40); "FICA"; PRINT TAB(50); "Sit"; TAB(60); "NetPay"; TAB(70); "Count"; TAB(80); "|" PRINT "|"; "Current"; TAB(10); grosspay; TAB(20); wctax; TAB(30); sditax; PRINT TAB(40); ficatax; TAB(50); sitax; TAB(60); netpay; TAB(80); "|" PRINT "|"; "YTD"; TAB(10); grosspayytd; TAB(20); wctaxytd; TAB(30); sditaxytd; PRINT TAB(40); ficataxytd; TAB(50); sitaxytd; TAB(60); netpayytd; TAB(70); counter; TAB(80); "|" FOR x = 1 TO 80 PRINT "="; NEXT x END SELECT INPUT "Enter -999 to quit, else touch anykey to continue"; next$ LOOP DATA .015,.0015,.20,.02,10 END