Anonymous

# 依以下題目寫出ASP的完整程式!

Rating

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitiona...

<script runat="server">

Const Ten As Integer = 10

Const Five As Integer = 5

Const One As Integer = 1

Sub btn_Caculator_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btn_Caculator.Click

Dim Count As Integer = Val(txCount.Text)

Dim TenCoin, FiveCoin, OneCoin As Integer

TenCoin = Count \ Ten

Count = Count Mod Ten

FiveCoin = Count \ Five

Count = Count Mod Five

OneCoin = Count

laTen.Text = TenCoin

laFive.Text = FiveCoin

laOne.Text = OneCoin

End Sub

</script>

<html xmlns="http://www.w3.org/1999/xhtml" >

<title>未命名頁面</title>

<body>

<form id="form1" runat="server">

<div>

<table style="border:1px; border-color:Blue">

<tr>

<td>總金額</td><td><asp:TextBox ID="txCount" runat="server"></asp:TextBox></td>

</tr>

<tr>

<td>10元個數</td><td><asp:Label ID="laTen" runat="server"></asp:Label></td>

</tr>

<tr>

<td>5元個數</td><td><asp:Label ID="laFive" runat="server"></asp:Label></td>

</tr>

<tr>

<td>1元個數</td><td><asp:Label ID="laOne" runat="server"></asp:Label></td>

</tr>

<tr>

<td>計算</td><td><asp:Button ID="btn_Caculator" runat="server" Text="計算"/></td>

</tr>

</table>

</div>

</form>

</body>

</html>

Source(s): me