• 沒有找到結果。

2014.12.23 電腦軟體設計丙級基本題1-5

N/A
N/A
Protected

Academic year: 2021

Share "2014.12.23 電腦軟體設計丙級基本題1-5"

Copied!
3
0
0

加載中.... (立即查看全文)

全文

(1)

2014.12.24 電腦軟體設計丙級 1-5 基本題 (By:陳致中老師講義)

Private Sub Command1_Click() Dim A, B, C, D As String

Open "C:\title.txt" For Input As #1 Input #1, A, B, C, D Close #1 Printer.Print "姓名:" & A, Printer.Print "准考證號碼:" & C Printer.Print "座號:" & B, Printer.Print "日期:" & D ex1 ex2 ex3 ex4 ex5 Printer.EndDoc End Sub

Private Sub Form_Load() A = Shell("C:\11900\title.exe", 1) End Sub

Private Sub ex1()

'*************************************** '* 11900-940301 program start * '*************************************** Open "C:\11900\940301.T01" For Input As #1 Input #1, A Close #1 AA = A For I = 1 To 20 M = A Mod 10 A = A \ 10 B = B * 10 + M If A = 0 Then Exit For Next I

If AA = B Then

Printer.Print "第一題結果:" & AA & " is a palindrome" Else

Printer.Print "第一題結果:" & AA & " is not a palindrome" End If

End Sub

Private Sub ex1()

'*************************************** '* 11900-940301 program start * '*************************************** Open "C:\11900\940301.T02" For Input As #1 Input #1, A Close #1 AA = A Do While A <> 0 M = A Mod 10 A = A \ 10 B = B * 10 + M Loop If AA = B Then

Printer.Print "第一題結果:" & AA & " is a palindrome" Else

Printer.Print "第一題結果:" & AA & " is not a palindrome" End If

End Sub

Private Sub ex2()

'*************************************** '* 11900-940302 program start * '*************************************** Open "C:\11900\940302.T01" For Input As #1 Input #1, A Close #1 Printer.Print "第二題結果:" For I = 1 To A For J = 1 To I Printer.Print J; Next J Printer.Print Next I End Sub

Private Sub ex2()

'*************************************** '* 11900-940302 program start * '*************************************** Open "C:\11900\940302.T02" For Input As #1 Input #1, A Close #1 Printer.Print "第二題結果:" I = 1 Do While I <= A J = 1 Do While J <= I Printer.Print J; J = J + 1 Loop Printer.Print I = I + 1 Loop End Sub

Private Sub ex3()

'*************************************** '* 11900-940303 program start * '*************************************** Open "C:\11900\940303.T01" For Input As #1 Input #1, A

Close #1 TEST = 1 For I = 2 To A - 1

TEST = TEST * (A Mod I) Next I

If TEST = 0 Then

Printer.Print "第三題結果:" & A & " is not a prime number." Else

Printer.Print "第三題結果:" & A & " is a prime number." End If

End Sub

Private Sub ex3()

'*************************************** '* 11900-940303 program start * '*************************************** Open "C:\11900\940303.T02" For Input As #1 Input #1, A

Close #1 TEST = 1 I = 2

Do While I <= A \ 2

TEST = TEST * (A Mod I) I = I + 1

(2)

If TEST = 0 Then

Printer.Print "第三題結果:" & A & " is not a prime number." Else

Printer.Print "第三題結果:" & A & " is a prime number." End If

End Sub

Private Sub ex4()

'*************************************** '* 11900-940304 program start * '*************************************** Dim BMI, C As Integer

Open "C:\11900\940304.T01" For Input As #1 BMI = 99

For I = 1 To 3 Input #1, A, B A = A / 100 C = B / (A * A)

If C < BMI Then BMI = C Next I

Close #1

If BMI < 20 Or BMI > 25 Then

Printer.Print "第四題結果:最小 BMI 值=" & BMI & ",不正常" Else

Printer.Print "第四題結果:最小 BMI 值=" & BMI & ",正常" End If

End Sub

Private Sub ex4()

'*************************************** '* 11900-940304 program start * '*************************************** Dim BMI, C As Integer

Open "C:\11900\940304.T02" For Input As #1 BMI = 99 I = 1 Do Input #1, A, B A = A / 100 C = B / (A * A)

If C < BMI Then BMI = C I = I + 1

Loop While I <= 3

Close #1

If BMI < 20 Or BMI > 25 Then

Printer.Print "第四題結果:最小 BMI 值=" & BMI & ",不正常" Else

Printer.Print "第四題結果:最小 BMI 值=" & BMI & ",正常" End If

End Sub

Private Sub ex5()

'*************************************** '* 11900-940305 program start * '*************************************** Dim A(2, 2), B(2, 2), S(2, 2) As Integer

Open "C:\11900\940305.T01" For Input As #1 Input #1, A(1, 1), A(1, 2), A(2, 1), A(2, 2) Input #1, B(1, 1), B(1, 2), B(2, 1), B(2, 2) Close #1

Printer.Print "第五題結果:" For I = 1 To 2

For J = 1 To 2

S(I, J) = A(I, J) + B(I, J) Next J

Printer.Print "[" & S(I, 1), S(I, 2) & "]" Next I

End Sub

Private Sub ex5()

'*************************************** '* 11900-940305 program start * '*************************************** Dim A(2, 2), B(2, 2), S(2, 2) As Integer

Open "C:\11900\940305.T02" For Input As #1 Input #1, A(1, 1), A(1, 2), A(2, 1), A(2, 2) Input #1, B(1, 1), B(1, 2), B(2, 1), B(2, 2) Close #1 Printer.Print "第五題結果:" I = 1 Do While I <= 2 J = 1 Do While J <= 2

S(I, J) = A(I, J) + B(I, J) J = J + 1

Loop

Printer.Print "[" & S(I, 1), S(I, 2) & "]" I = I + 1

Loop End Sub

程式一開始執行會先執行程式碼 A = Shell("C:\11900\title.exe", 1),接 著會出現底下畫面,資料填完後記得按確定。

平時練習建議先安裝虛擬印表機如 doPDF 、Bullzip PDF Printer, 實際考試每人均有印表機列印喔!執行畫面如下(實際考試是五題當 中抽3題測驗,且測試檔案切勿弄錯):

(3)

參考文獻

相關文件

3.丙級:包括應用作業系統、安裝軟體與使用電腦週邊設 備、設定繪圖環境、控制圖形螢幕、輸出圖形與 管理圖面等基本工作及繪製單件立體圖、立體剖

[r]

[r]

【5+2產業】亞洲矽谷 電腦資訊技術類 物聯網自動灌溉與排水系統設計班. 【5+2產業】亞洲矽谷

包括三維機械設計的所更的功能(SolidWorks 三維建模軟體)、資料管 理軟體 PDMWorks Client、以及用於設計交流的常用工具:eDrawings 專 業版(基於 e-mail 的設計交流工具),

利用 Microsoft Access 資料庫管理軟體,在 PC Windows 作業系統環境 下,將給與的紙本或電子檔(如 excel

(軟體應用) 根據商務活動之舉辦目標及系統需求,應用 Microsoft Office 文書處理 Word、電子試算表 Excel、電腦簡報 PowerPoint、資料庫 Access

802.14為主流,參與成員多為電腦及電話 公司,協定的主體已經確立,預計在今年 十一月完成標準草案的制定,1998年六月 正式成為IEEE標準。基本上來說,IEEE 802.14受到四個標準單位影響: