06.08.2013 Views

03 林家民

03 林家民

03 林家民

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

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

就顯示”成績不及格”的訊息<br />

檔案名稱:<strong>03</strong> \ ch5 \ P.138<br />

表單:<br />

程式碼:<br />

Private Sub Form_Activate()<br />

Dim score As Integer<br />

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

If score >= 60 Then<br />

MsgBox "成績及格了", 48, "恭喜"<br />

Else: MsgBox "成績不及格", 16, "再加油"<br />

End If<br />

End Sub<br />

執行結果:ex.輸入 60

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

Saved successfully!

Ooh no, something went wrong!