1 thename% = 0 thepassword$ = "PSCC" 10 CLS PRINT PRINT PRINT PRINT PRINT PRINT " Time Clock" PRINT PRINT PRINT PRINT PRINT PRINT PRINT " 1. Sign in" PRINT " 2. Break for Lunch" PRINT " 3. Sign out" PRINT " 4. Admin" PRINT PRINT PRINT INPUT ; a% IF a% = 1 THEN action% = 1: GOTO 20 IF a% = 2 THEN action% = 2: GOTO 30 IF a% = 3 THEN action% = 3: GOTO 40 IF a% = 4 THEN GOTO 50 IF a% = 5 THEN END IF a% > 4 OR a% < 1 THEN PRINT "Not a valid selection": : GOTO 10 20 PRINT INPUT "First name"; thename$ 'OPEN thename$ FOR INPUT AS #1 'INPUT #1, thename$ 'DO UNTIL EOF(1) 'INPUT #1, thetime$, thedate$, action% 'LOOP 'PRINT thetime$, thedate$, action% OPEN thename$ FOR INPUT AS #1 INPUT #1, thename$ IF EOF(1) THEN CLOSE #1: GOTO 21 DO UNTIL EOF(1) INPUT #1, thehour%, theminute%, thedate$, action% LOOP CLOSE #1 IF action% = 1 THEN PRINT "Already signed in at", thehour%, theminute%; "on", thedate$ IF action% = 2 THEN GOTO 22 IF action% = 3 THEN GOTO 21 INPUT b% GOTO 10 21 action% = 1 thehour% = VAL(TIME$) theminute% = VAL(RIGHT$(TIME$, 5)) IF theminute% < 7 AND theminute% >= 0 THEN theminute% = 0 IF theminute% < 22 AND theminute% >= 8 THEN theminute% = 15 IF theminute% < 37 AND theminute% >= 23 THEN theminute% = 30 IF theminute% < 52 AND theminute% >= 38 THEN theminute% = 45 IF theminute% < 59 AND theminute% >= 53 THEN theminute% = 0: thehour% = thehour% + 1 OPEN thename$ FOR APPEND AS #1 WRITE #1, thehour%, theminute%, DATE$, action% CLOSE #1 T$ = TIME$ Hr = VAL(T$) IF thehour% < 12 THEN Ampm$ = " AM" ELSE Ampm$ = " PM" IF thehour% > 12 THEN thehour% = thehour% - 12 IF thehour% = 0 THEN thehour% = 12 PRINT "The time is:"; TIME$ PRINT "Signed in at "; thehour%; theminute%; Ampm$ PRINT thename$, action$; TIME$, DATE$, action% INPUT ; b% GOTO 10 22 thehour% = VAL(thetime$) theminute$ = RIGHT$(thetime$, 5) theminute% = VAL(theminute$) thetime$ = RIGHT$(T$, 5) thetime% = VAL(thetime$) thehournow% = VAL(TIME$) theminutenow% = VAL(RIGHT$(TIME$, 5)) totalminutes% = theminutenow% - theminute% action% = 1 OPEN thename$ FOR APPEND AS #1 WRITE #1, TIME$, DATE$, action% CLOSE #1 PRINT thename$, action$; TIME$, DATE$, action% PRINT "Back from break, break length:", (thehournow% - thehour%), "hours", (theminutenow% - theminute%), "minutes" INPUT b% GOTO 10 30 PRINT INPUT "First name"; thename$ OPEN thename$ FOR INPUT AS #1 INPUT #1, thename$ IF EOF(1) THEN CLOSE #1: PRINT "Never signed in before.": INPUT b%: GOTO 10 DO UNTIL EOF(1) INPUT #1, thetime$, thedate$, action% LOOP CLOSE #1 IF action% = 1 THEN GOTO 32 IF action% = 2 THEN PRINT "Already on break started at:": PRINT thetime$: PRINT thedate$: PRINT : INPUT b%: GOTO 10 IF action% = 3 THEN PRINT "Never signed in, last signed out at: ": PRINT thetime$: PRINT thedate$: PRINT : INPUT b%: GOTO 10 INPUT b% GOTO 10 32 action% = 2 OPEN thename$ FOR APPEND AS #1 WRITE #1, TIME$, DATE$, action% CLOSE #1 PRINT thename$, TIME$, DATE$, action% INPUT ; b% GOTO 10 40 PRINT INPUT "First name"; thename$ action% = 0 OPEN thename$ FOR INPUT AS #1 INPUT #1, thename$ IF EOF(1) THEN CLOSE #1: PRINT "EOF": GOTO 42 DO UNTIL EOF(1) INPUT #1, thetime$, thedate$, action% LOOP CLOSE #1 IF action% = 1 THEN GOTO 41 IF action% = 2 THEN GOTO 42 IF action% = 3 THEN GOTO 42 41 action% = 3 OPEN thename$ FOR APPEND AS #1 WRITE #1, TIME$, DATE$, action% CLOSE #1 PRINT thename$, TIME$, DATE$, action% INPUT ; b% GOTO 10 42 IF action% = 2 THEN PRINT "Still on break started at:": PRINT thetime$: PRINT thedate$: PRINT : INPUT b%: GOTO 10 IF action% = 3 THEN PRINT "Never signed in, last signed out at: ": PRINT thetime$: PRINT thedate$: PRINT : INPUT b%: GOTO 10 PRINT "New person, never signed in": PRINT : INPUT b%: GOTO 10 INPUT b% GOTO 70 GOTO 10 50 PRINT INPUT "What is the password"; thepassword$ IF thepassword$ = "PSCC" THEN GOTO 51 GOTO 1 51 CLS PRINT status$ status$ = "" PRINT PRINT PRINT PRINT PRINT PRINT PRINT PRINT " 1.) Add Person" PRINT " 2.) Run Weekly Report" PRINT " 3.) View Personal Report" PRINT " 4.) Change Password" PRINT " 5.) Set Start of Pay Week" PRINT " 6.) Go back" PRINT PRINT PRINT PRINT INPUT ; choice% IF choice% = 1 THEN GOTO 60 IF choice% = 2 THEN GOTO 70 IF choice% = 3 THEN GOTO 80 IF choice% = 4 THEN GOTO 90 IF choice% = 5 THEN GOTO 100 IF choice% = 6 THEN GOTO 10 60 PRINT INPUT "First Name"; thename$ INPUT "What is the password"; thepassword$ IF thepassword$ = "PSCC" THEN GOTO 61 INPUT "What is the password"; thepassword$ IF thepassword$ = "PSCC" THEN GOTO 61 GOTO 1 61 OPEN thename$ FOR OUTPUT AS #1 WRITE #1, thename$ CLOSE #1 status$ = thename$ + " has been added" GOTO 51 70 T$ = TIME$ thetime$ = RIGHT$(T$, 5) thetime% = VAL(thetime$) PRINT thetime% GOTO 51 80 PRINT INPUT "First name"; thename$ OPEN thename$ FOR INPUT AS #1 INPUT #1, thename$ IF EOF(1) THEN CLOSE #1: PRINT "EOF": PRINT : INPUT ; b%: GOTO 51 DO UNTIL EOF(1) INPUT #1, thetime$, thedate$, action% PRINT thetime$; " "; thedate$; action% LOOP CLOSE #1 INPUT b% GOTO 51 90 thetime$ = "19:25:42" thehour% = VAL(thetime$) theminute% = VAL(RIGHT$(thetime$, 5)) IF theminute% < 7 AND theminute% >= 0 THEN theminute% = 0 IF theminute% < 22 AND theminute% >= 8 THEN theminute% = 15 IF theminute% < 37 AND theminute% >= 23 THEN theminute% = 30 IF theminute% < 52 AND theminute% >= 38 THEN theminute% = 45 IF theminute% < 59 AND theminute% >= 53 THEN theminute% = 0: thehour% = thehour% + 1 thehournow% = VAL(TIME$) theminutenow% = VAL(RIGHT$(TIME$, 5)) totalminutes% = theminutenow% - theminute% totalhours% = thehournow% - thehour% PRINT thehour%; " "; theminute% totalminutes% = theminutenow% - theminute% totalhours% = thehournow% - thehour% IF totalminutes% < 0 THEN totalminutes% = 60 - (totalminutes% * -1): totalhours% = totalhours% - 1 IF thehour% > 12 THEN thehour% = thehour% - 12 PRINT totalhours%; "hours"; totalminutes%; "minutes." colon$ = ":" colon$ = colon$ + STR$(theminute%) PRINT colon$ PRINT STR$(theminute%) PRINT STR$(thehour%); colon$ INPUT b% END 100 DO T$ = TIME$ Hr = VAL(T$) IF Hr < 12 THEN Ampm$ = " AM" ELSE Ampm$ = " PM" IF Hr > 12 THEN Hr = Hr - 12 LOCATE 1, 1: PRINT "The time is"; STR$(Hr); RIGHT$(T$, 6); Ampm$ LOOP