科目名稱:資訊系統 與網路導論 | 開課系所:資訊工程 學系 | 任課教師 |
吳坤熹 |
||
系所別: |
年級: |
學號: |
姓名: |
考試日期 |
2009.10.9 |
(考試時間: 08:30-09:00)
10 PRINT CHR$(ASC("0")+1) 20 PRINT 1/SIN(ATN(1)*4/6) 30 PRINT INSTR(2, "NCNU", "N") 40 PRINT LEN("NCNU") 50 PRINT 625^(1/4) 60 D$=DATE$ 70 PRINT LEFT$(D$,2) + MID$(D$, 4, 2) + RIGHT$(D$,4) 80 PRINT VAL(LEFT$(D$,2)) + VAL(MID$(D$, 4, 2)) + VAL(RIGHT$(D$,4)) 90 END
10 DATA 2009, 10, 9 20 DATA "January", "February", "March", "April", "May", "June" 30 DATA "July", "August", "September", "October", "November", "December" 40 DATA 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 50 DIM MONTH$(12), A(12) 60 RESTORE 10 70 READ Y, M, D 80 FOR I = 1 TO 12 90 READ MONTH$(I) 100 NEXT I 110 FOR I = 1 TO 12 120 READ A(I) 130 NEXT I 140 REM --- Is this a leap year? 150 IF Y MOD 4 = 0 THEN LEAP = 1 ELSE LEAP = 0 160 IF Y MOD 100 = 0 THEN LEAP = 0 170 IF Y MOD 400 = 0 THEN LEAP = 1 180 A(2) = A(2) + LEAP 190 REM --- What day is January 1st? 200 LET N = Y - 1 210 DAY = (1 + N + INT(N/4) - INT(N/100) + INT(N/400) ) MOD 7 220 WEEKDAYS$ = " Sun Mon Tue Wed Thu Fri Sat" 230 PRINT MID$(WEEKDAYS$, 4*DAY+1, 4) 240 REM --- What day is today? 250 LET I = 1 260 DO WHILE I < M 270 DAY = DAY + A(I) 280 I = I + 1 290 LOOP 300 DAY = DAY MOD 7 310 TODAY = (DAY + D - 1) MOD 7 320 PRINT MID$(WEEKDAYS$, 4*TODAY+1, 4) 330 REM --- Prepare to print calendar for this month 340 PRINT TAB(10); MONTH$(M); Y 350 PRINT 360 PRINT WEEKDAYS$ 370 FOR I=1 TO 7 380 PRINT " ==="; 390 NEXT I 400 PRINT 410 BEGIN = DAY 420 GOSUB 440 430 END 440 REM --- Subprogram to print a month 450 REM --- Input: BEGIN 460 I = 0 470 DO WHILE I < BEGIN 480 PRINT SPC(4); 490 I = I + 1 500 LOOP 510 FOR I = 1 TO A(M) 520 PRINT USING " ##&"; I; SPACE$(1); 530 BEGIN = BEGIN + 1 540 IF BEGIN = 7 THEN BEGIN = 0 : PRINT 550 NEXT I 560 PRINT 570 RETURN