06.08.2013 Views

03 林家民

03 林家民

03 林家民

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

題目說明:判斷成績是否大於等於 60?若是,便顯示”成績及格”的訊息<br />

檔案名稱:<strong>03</strong> \ ch5 \ P.135-1<br />

表單:<br />

程式碼:<br />

Private Sub Form_Activate()<br />

Dim score As Integer<br />

score = InputBox("請輸入成績", "成績輸入")<br />

If score >= 60 Then MsgBox "成績及格了", 48, "恭喜"<br />

If score < 60 Then MsgBox "成績不及格", 16, "再加油"<br />

End Sub<br />

執行結果:ex.輸入 60

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!