識用 Visual Basic 2005請進。

2007-09-27 8:56 pm
Writing a program to request the name of a baseball team, the number of games won, and the number of games lost as input, and then display the name of the team and the percentage of games won. A sample run is shown in attached file.
==>

之後請到 : http://hk.geocities.com/jason10312008/3-4-E46.JPG

或者有人做去後將xxxxx.vb上傳/send俾我 (i.e. Form1.vb) .
感激不盡。

回答 (2)

2007-09-28 9:03 am
✔ 最佳答案
The exercise is about checking for numeric values and rounding the number to the correct decimal places.

Look up the documentation for TryParse() method.

Dim won As Integer = 0
Dim lost As Integer = 0
If Not Int32.TryParse(txtWon.Text, won) Then
' txtWon.Text not numeric
Return
End If
If Not Int32.TryParse(txtLost.Text, lost) Then
' txtLost.Text not numeric
Return
End If
Dim WinPct As Decimal = Decimal.Round(Convert.ToDecimal(won * 100 / (won + lost)), 3)
2007-09-28 3:44 am
1.你個個好似唔係05黎=.=
2.你將won同lost既值轉成百分數,依個係初中數學黎喎= =
lost/won*100=won percentage


收錄日期: 2021-04-25 20:34:52
原文連結 [永久失效]:
https://hk.answers.yahoo.com/question/index?qid=20070927000051KK01090

檢視 Wayback Machine 備份