1 / 12

計算機概論期末報告

計算機概論期末報告. 收. 費. 系. 統. 奈米一乙 4A014045 薛宇翔. 題目說明. 此系統為先輸入您進場時間,取得一收費價錢,因為擁有者報告作的辛苦,所以知道學分難賺,在此做個抽獎娛樂大家,按抽獎鍵取得一折扣數值,再選擇你所抽中之折扣數,即會顯示出最終應付之金額。. 使用說明. 選擇進場之時間及日期,按 停車金額鍵 ,即會取得停車之時間及金額。. 使用說明. 按 抽獎鍵 ,即會取得一折扣數。. 使用說明. 選擇所抽中之 折扣數值 ,即會出現所應付之日圓金額。. 版面配置屬性設定. 折扣圖片 PictureBox1. 時間標題 Label3.

Download Presentation

計算機概論期末報告

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. 計算機概論期末報告 收 費 系 統 奈米一乙 4A014045 薛宇翔

  2. 題目說明 此系統為先輸入您進場時間,取得一收費價錢,因為擁有者報告作的辛苦,所以知道學分難賺,在此做個抽獎娛樂大家,按抽獎鍵取得一折扣數值,再選擇你所抽中之折扣數,即會顯示出最終應付之金額。

  3. 使用說明 選擇進場之時間及日期,按停車金額鍵,即會取得停車之時間及金額。

  4. 使用說明 按抽獎鍵,即會取得一折扣數。

  5. 使用說明 選擇所抽中之折扣數值,即會出現所應付之日圓金額。

  6. 版面配置屬性設定 折扣圖片 PictureBox1 時間標題 Label3 顯示現在時間 Label4 抽獎鍵 Button1 進場時間標題 Label5 中獎圖示 Label1 選擇進場時間 DtpstarTime1 折扣選擇 GroupBox1 RadioButton1 RadioButton2 RadioButton3 RadioButton4 RadioButton5 顯示停車費 Label6 結算停車費鍵 Button2 應付金額顯示 Label2

  7. 程式碼 1Public Class Form1 2 Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load 3 tmrNow.Interval = 1000 4 tmrNow.Enabled = True 5 DtpstarTime.Format = DateTimePickerFormat.Custom 6 DtpstarTime.CustomFormat = "yyyy/M/d HH:mm" 7 DtpstarTime.ShowUpDown = True 8 DtpstarTime.MaxDate = Now 9 lb2price.Text = "停車費為°" 10 Me.Text = "收費打折系統" 11 Lb1point.Text = "先按抽獎" 12 Label2.Text = "應付金額“ 13 End Sub

  8. 程式碼 15 Private Sub btnok_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnok.Click 16 Dim getpoint As Integer 17 Randomize() 18 getpoint = Fix((9 - 5 + 1) * Rnd()) + 5 19 PICdice.Image = Image.FromFile(CStr(getpoint) & ".jpg") 20 Lb1point.Text = "恭喜獲得" & getpoint & "折!!" 21 End Sub 22 23 Private Sub tmrnow_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles tmrnow.Tick 24 lnow.Text = Now.ToString 25 End Sub

  9. 程式碼 27 Private Sub btn0k2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btn0k2.Click 28 Dim total_hours, day, hours, price As Integer total_hours = DateDiff(DateInterval.Hour, DtpstarTime.Value, Now) 29 day = Int(total_hours / 24) 30 hours = total_hours Mod 24 31 price = 1000 * day 32 Select Case hours 33 Case Is >= 1 : price += 500 34 End Select 35 lb2price.Text = "共停" & day & " 天 " & hours & " 小時" & "停車費為" & price & " 日圓" 36 End Sub

  10. 程式碼 38 Private Sub RadioButton5_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles RadioButton5.CheckedChanged, RadioButton4.CheckedChanged, RadioButton3.CheckedChanged, RadioButton2.CheckedChanged, RadioButton1.CheckedChanged 39 Dim total_hours, day, hours, price As Integer 40 total_hours = DateDiff(DateInterval.Hour, DtpstarTime.Value, Now) 41 day = Int(total_hours / 24) 42 hours = total_hours Mod 24 43 price = 1000 * day 44 Select Case hours 45 Case Is >= 1 : price += 500 46 End Select 47 If RadioButton1.Checked = True Then price = price * 0.5 48If RadioButton2.Checked = True Then price = price * 0.6 49If RadioButton3.Checked = True Then price = price * 0.7 50If RadioButton4.Checked = True Then price = price * 0.8 51If RadioButton5.Checked = True Then price = price * 0.9 52 Label2.Text = "¥FD" & price 53 End Sub 54 End Class

  11. 程式碼說明 3~4行要顯示時間必且每秒更新一次。 5~6行設定時間格式,並且進場時間不可晚於出場時間。 9~12行執行一開始Label所顯示之內容。 16行宣告它為一數值。 18行產生一9~5之亂數 。 19行讓產生之亂數值找到所配合之圖片。 20行顯示出恭喜獲得?折扣。

  12. 心得感想 Visual Basic 在高職時就上過了,但當時在上什麼,我根本知道在上什麼,但現在上完一學期還是不知道。老師上課時曾經提到過,把VB想成FB這樣所有的程式都不困難,還會自己想辦法解決,但是VB始終是VB不可能變成FB。就因為要交報告,所以不得不去理解它,終於皇天不負苦心人,讓我完成了一份屬自己的程式與報告。

More Related