VERSION 5.00 Begin VB.Form form1 Caption = "Form1" ClientHeight = 7860 ClientLeft = 60 ClientTop = 345 ClientWidth = 6405 BeginProperty Font Name = "MS Sans Serif" Size = 13.5 Charset = 0 Weight = 400 Underline = 0 'False Italic = 0 'False Strikethrough = 0 'False EndProperty LinkTopic = "Form1" ScaleHeight = 7860 ScaleWidth = 6405 StartUpPosition = 3 'Windows Default Begin VB.CommandButton cmdTicket Caption = "Compute Tickets" Height = 1095 Left = 1320 TabIndex = 9 Top = 6480 Width = 3975 End Begin VB.CommandButton cmdChange Caption = "Compute Change" Height = 495 Left = 3000 TabIndex = 8 Top = 5640 Width = 3015 End Begin VB.TextBox txtCost Height = 495 Left = 1440 TabIndex = 6 Text = "5.99" Top = 5640 Width = 975 End Begin VB.CommandButton cmdGo Caption = "Go" Height = 495 Left = 4800 TabIndex = 5 Top = 4800 Width = 1215 End Begin VB.TextBox txtCheck Height = 495 Left = 3240 TabIndex = 4 Text = "rca" Top = 4800 Width = 1215 End Begin VB.TextBox txtBig Height = 495 Left = 480 TabIndex = 3 Text = "Supercalifragelistic" Top = 4800 Width = 2535 End Begin VB.TextBox txtDate Height = 495 Left = 3120 TabIndex = 2 Text = "02-12-2009" Top = 3720 Width = 1815 End Begin VB.CommandButton cmdGetDate Caption = "Get Date" Height = 495 Left = 360 TabIndex = 1 Top = 3720 Width = 1695 End Begin VB.PictureBox picPretty Height = 3135 Left = 240 ScaleHeight = 3075 ScaleWidth = 5955 TabIndex = 0 Top = 240 Width = 6015 End Begin VB.Label Label1 Caption = "Cost:" Height = 495 Left = 360 TabIndex = 7 Top = 5640 Width = 855 End End Attribute VB_Name = "form1" Attribute VB_GlobalNameSpace = False Attribute VB_Creatable = False Attribute VB_PredeclaredId = True Attribute VB_Exposed = False Option Explicit Private Sub cmdChange_Click() Const cash_on_hand As Double = 10 Dim cost As Double cost = Val(txtCost.Text) Dim change As Double change = cash_on_hand - cost picPretty.Cls picPretty.Print "Your change from $10 is"; change Dim fancy_money As String fancy_money = FormatCurrency(change) picPretty.Print "Your change from $10 is "; fancy_money End Sub Private Sub cmdGetDate_Click() Dim original_date As String original_date = txtDate.Text Dim super_fancy_date As String super_fancy_date = FormatDateTime(original_date, vbLongDate) picPretty.Print super_fancy_date picPretty.Print "Independence day will be:" super_fancy_date = FormatDateTime("7/4/2009", vbLongDate) picPretty.Print super_fancy_date Dim month_part As String month_part = Left(original_date, 2) picPretty.Print "Month is "; month_part Dim year_part As String year_part = Right(original_date, 4) picPretty.Print "Year is "; year_part Dim year As Integer year = Val(year_part) picPretty.Print "Next year will be "; year + 1 Dim day_part As String day_part = Mid(original_date, 4, 2) picPretty.Print "The day is "; day_part End Sub Private Sub cmdGo_Click() picPretty.Cls Dim big_word As String Dim little_word As String big_word = txtBig.Text little_word = txtCheck.Text Dim location As Integer location = InStr(big_word, little_word) picPretty.Print "Location is: "; location Dim big_all_caps As String Dim little_all_caps As String big_all_caps = UCase(big_word) little_all_caps = UCase(little_word) picPretty.Print "Ignoring upper/lower case"; picPretty.Print " loc is: "; location = InStr(big_all_caps, little_all_caps) picPretty.Print location Dim how_long As Integer how_long = Len(big_word) picPretty.Print big_word; " is "; picPretty.Print how_long; " letters long" End Sub Private Sub cmdTicket_Click() Dim students As Integer Const SEATS As Integer = 2000 students = Val(InputBox("How many Students?")) Dim tickets_each As Integer Dim tickets_leftover As Integer tickets_each = SEATS \ students 'note backwards divided by tickets_leftover = SEATS Mod students Dim funky_message As String funky_message = "Each student gets " + Str(tickets_each) funky_message = funky_message + " with " funky_message = funky_message + Str(tickets_leftover) funky_message = funky_message + " leftover" MsgBox funky_message End Sub