adsense

2010-10-01

[vistual studio] 成績計算軟體



Imports System.Math


Public Class Form1



Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load

Button1.Text = "計算"

Button2.Text = "微調"

Button2.Visible = False

Label15.Visible = False

Label16.Visible = False

Label18.Visible = False

ControlBox = False '右上角的小叉叉+縮小



End Sub



Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click

Button2.Visible = True



'平時成績 c是轉換字元 如: 將形態轉乘成int 或 double ......等

Dim a As Double = CInt(TextBox5.Text) + CInt(TextBox7.Text)

Dim b as double= CInt(TextBox4.Text) + a

Label15.Text = b / 3



'期中期末

Dim c As Double = (CInt(TextBox1.Text) * CInt(TextBox6.Text)) + (CInt(TextBox2.Text) * CInt(TextBox8.Text)) '期中加上期末

dim d as double =CInt(Label15.Text) + c

Label16.Text = d \ 100

Label15.Visible = True '顯示平時成績

Label16.Visible = True ' 顯示平時+期中期末成績





End Sub



Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click

Dim countsqr = Sqrt(Label16.Text) 'sqrt 是開根號函數

Label18.Text = countsqr * 10 '開根號*10

Label18.Visible = True '顯示微調成績

End Sub

End Class

沒有留言:

張貼留言