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 CLS MenuOption = 0 DO WHILE MenuOption <> 7 CLS PRINT PRINT PRINT " M E N U" PRINT "----------------" PRINT "1. Input Data " PRINT "2. Display Data" 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 OPEN "c:\temp\team.txt" FOR APPEND AS #1 teamname$ = " " DO WHILE teamname$ <> "QUIT" CLS INPUT "Enter the Team name"; teamname$ Playername$ = " " DO WHILE Playername$ <> "QUIT" CLS INPUT "Enter the Player name"; Playername$ INPUT "enter the player number"; playernum$ INPUT "Enter the Players total hits:"; playerhits INPUT "Enter the Players total at bat"; playerab INPUT "Enter the Players Home runs"; playerHomeRuns WRITE #1, teamname$, Playername$, playerhits, playerab, playerHomeRuns, playernum$ INPUT "Enter Quit for another team, else touch anykey to enter another player"; Playername$ Playername$ = UCASE$(Playername$) LOOP INPUT "Enter Quit to return to main menu, else touch anykey to enter another team"; teamname$ teamname$ = UCASE$(teamname$) LOOP CLOSE #1 REM INPUT "touch any key to continue"; anykey$ CASE IS = 2 OPEN "c:\temp\team.txt" FOR INPUT AS #1 PRINT "Team name"; TAB(10); "Playername"; TAB(25); "number"; TAB(35); PRINT "hits"; TAB(41); " At Bat"; TAB(51); "Home Runs"; TAB(60); "Average" DO WHILE NOT EOF(1) INPUT #1, teamname$, Playername$, playerhits, playerab, playerHomeRuns Averagebat = playerhit / playerab sumab = sumab + playerab sumhits = sumhits + playerhits teamavg = sumhits / sumab count = count + 1 PRINT teamname$; TAB(10); Playername$; TAB(25); playernum$; TAB(35); PRINT playerhits; TAB(41); playerab; TAB(51); playerHomeRuns; TAB(60); Averagebat LOOP PRINT "Team Average"; teamavg CLOSE #1 INPUT "touch any key to contineu"; anykey$ PRINT "option 2" 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 END REM Input Section REM Processing Section REM Output Section