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 blank sales receipt REM REM Variables REM REM Formulas REM REM Design REM REM Algorithm REM REM 1. REM 2. REM 3. REM 4. Etc. REM REM Implementation - here you begin to code. CLS GOSUB initilize GOSUB menu END REM Input Section REM Processing Section REM Output Section REM subrountines++++++++++++++++++++++++++++++++++++++++++++++++++++++++= menu: CLS MenuOption = 0 DO WHILE MenuOption <> 7 CLS PRINT PRINT PRINT " M E N U" PRINT "----------------" PRINT "1. Input Employee name and amount of piece work " PRINT "2. Display summary report" PRINT "3. OPTION 3" PRINT "4. OPTION 4" PRINT "5. OPTION 5" PRINT "6. OPTION 6" PRINT "7. EXIT PROGRAM" PRINT INPUT "YOUR CHOICE =>"; MenuOption SELECT CASE MenuOption CASE IS = 1 GOSUB inputemp CASE IS = 2 CLS GOSUB summaryrpt CASE IS = 3 PRINT PRINT "You selected option 3." CASE IS = 4 PRINT PRINT "You selected option 4." CASE IS = 5 PRINT PRINT "you have selected option 5" CASE IS = 6 PRINT PRINT "You have selected option 6" CASE IS = 7 PRINT PRINT "Thank you for using this program." CASE ELSE PRINT PRINT "Invalid Menu Option" END SELECT LOOP RETURN initilize: FIRSTNAME$ = " " LASTNAME$ = " " PIECES = 0 PAY = 0 totalpay = 0 totalpices = 0 looper$ = " " looper2$ = " " RETURN inputemp: CLS OPEN "c:\employee.txt" FOR APPEND AS #1 looper$ = " " DO WHILE looper$ <> "QUIT" INPUT "Enter employee's first name"; FIRSTNAME$ INPUT "Enter employee's last name"; LASTNAME$ INPUT "Enter the number of pieces completed"; PIECES GOSUB process WRITE #1, FIRSTNAME$, LASTNAME$, PIECES, PAY INPUT "Touch enter to continue with another employee, else enter QUIT"; looper$ looper$ = UCASE$(looper$) LOOP CLOSE #1 RETURN process: IF PIECES >= 600 THEN PAY = PIECES * .65 ELSEIF PIECES >= 400 THEN PAY = PIECES * .6 ELSEIF PIECES >= 200 THEN PAY = PIECES * .55 ELSE PAY = PIECES * .5 END IF RETURN summaryrpt: PRINT TAB(28); "PIECEWORK WEEKLY REPORT" PRINT PRINT TAB(5); "NAME"; TAB(30); "PIECES"; TAB(45); "PAY" PRINT OPEN "c:\employee.txt" FOR INPUT AS #1 DO WHILE NOT EOF(1) INPUT #1, FIRSTNAME$, LASTNAME$, PIECES, PAY PRINT FIRSTNAME$; TAB(15); LASTNAME$; TAB(30); PIECES; TAB(43); PAY SUMPAY = SUMPAY + PAY SUMPIECES = SUMPIECES + PIECES LOOP CLOSE #1 PRINT PRINT TAB(5); "TOTALS"; TAB(30); SUMPIECES; PRINT USING "$$###,###.##"; TAB(38); SUMPAY INPUT "TOUCH ENTER TO CONTINUE"; ANYKEY$ RETURN