計算機程式及 實習 期末報告 ppt 製作 題目 :psv 遊戲販售
DESCRIPTION
計算機程式及 實習 期末報告 ppt 製作 題目 :PSV 遊戲販售. 南台科技大學 機械工程 系 自控一 甲 學號 :4A20H002 姓名 : 葉宸侑 老師 謝慶存. PSV 遊戲販售系統. ListBox 、 RadioButton 的使用方法。. PSV 遊戲販售說明. 把各種遊戲購買數量輸入 , 按下計算即可計算金額。 一般會員 9 折 白金會員 8 折 黃金會員 75 折. 程式開始畫面. 購買 使用 3 步驟. 1. 選擇需求數量 2. 選擇會員資格 3. 按下計算. 程式使用說明. - PowerPoint PPT PresentationTRANSCRIPT
南台科技大學機械工程系
自控一甲學號 :4A20H002
姓名 : 葉宸侑老師 謝慶存
計算機程式及實習
期末報告 PPT 製作
題目 :PSV 遊戲販售
PSV 遊戲販售系統
ListBox 、 RadioButton 的使用方法。
PSV 遊戲販售說明
• 把各種遊戲購買數量輸入,按下計算即可計算金額。
• 一般會員 9 折• 白金會員 8 折• 黃金會員 75 折
程式開始畫面
購買使用 3 步驟
1. 選擇需求數量
2. 選擇會員資格
3. 按下計算
程式使用說明
更改真鋼彈無雙 ( 日文版 )數量為 1 和一般會員優惠按「計算」按鈕後,得到結帳資料。
程式功能說明
版面配置屬性設定
金額Label6Label7
遊戲Label1Label2Label3
購買明細表ListBox1
價格TextBox1TextBox2TextBox3
數量TextBox4TextBox5TextBox6
會員優惠GroupBox1RadioButton
1RadioButton
2RadioButton
3
清除Button2
計算Button1
程式碼設計
Public Class Form1 Dim total, accTotal As Integer Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load Label6.Text = "$" & total & " 元 " Label7.Text = " 累計: $" & accTotal & " 元 " Label6.Font = New Font(" 細明體 ", 24) Label6.ForeColor = Color.Red total = 0 accTotal = 0 End Sub
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click total = Val(TextBox1.Text) * Val(TextBox4.Text) + Val(TextBox2.Text) * Val(TextBox5.Text) + Val(TextBox3.Text) * Val(TextBox6.Text) If total > 2000 Then RadioButton3.Checked = True If RadioButton1.Checked = True Then total = total * 0.9 If RadioButton2.Checked = True Then total = total * 0.8 If RadioButton3.Checked = True Then total = total * 0.75 Label6.Text = "$" & total & " 元 " accTotal = accTotal + total Label7.Text = " 累計: $" & accTotal & " 元 " ListBox1.Items.Add(total & "-->" & " 真鋼彈無雙 ( 日文版 )" & TextBox1.Text & "*" & TextBox4.Text & " 真三國無雙 with 猛將傳 ( 中文版 )" & TextBox2.Text & "*" & TextBox5.Text & "GOD EATER2 製品版 ( 日文版 )" & TextBox3.Text & "*" & TextBox6.Text) End Sub
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click TextBox4.Text = 0 TextBox5.Text = 0 TextBox6.Text = 0 total = 0 Label6.Text = "$" & total & " 元 " End Sub
Private Sub ListBox1_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ListBox1.SelectedIndexChanged accTotal = accTotal - (Val(ListBox1.SelectedItem)) ListBox1.Items.RemoveAt(ListBox1.SelectedIndex) Label7.Text = " 累計: $" & accTotal & " 元 " End SubEnd Class
Visual Basic 滿有興趣的,比起其他也不會說很困難,對於初學者的我來說還算能滿快上手,雖然在編寫程式時也遇到滿多問題,但是還有個細心認真的老師,再加上這麼幽默風趣上課方式,課程也增添了許多活力,讓學習起來更
快樂。
心得
參考文獻
• 維基百科
• Visual Basic 2010 基礎必修 碁峰資訊 林義証 蔡文龍 張傑瑞 何叡著