Public Class Form1 Inherits System.Windows.Forms.Form #Region " Windows Form Designer generated code " Public Sub New() MyBase.New() 'This call is required by the Windows Form Designer. InitializeComponent() 'Add any initialization after the InitializeComponent() call End Sub 'Form overrides dispose to clean up the component list. Protected Overloads Overrides Sub Dispose(ByVal disposing As Boolean) If disposing Then If Not (components Is Nothing) Then components.Dispose() End If End If MyBase.Dispose(disposing) End Sub 'Required by the Windows Form Designer Private components As System.ComponentModel.IContainer 'NOTE: The following procedure is required by the Windows Form Designer 'It can be modified using the Windows Form Designer. 'Do not modify it using the code editor. Friend WithEvents Label1 As System.Windows.Forms.Label Friend WithEvents RadioButton1 As System.Windows.Forms.RadioButton Friend WithEvents RadioButton2 As System.Windows.Forms.RadioButton Friend WithEvents RadioButton3 As System.Windows.Forms.RadioButton Friend WithEvents CheckBox1 As System.Windows.Forms.CheckBox Friend WithEvents CheckBox2 As System.Windows.Forms.CheckBox Friend WithEvents CheckBox3 As System.Windows.Forms.CheckBox Friend WithEvents Label2 As System.Windows.Forms.Label Friend WithEvents TextBox1 As System.Windows.Forms.TextBox Friend WithEvents Label3 As System.Windows.Forms.Label Friend WithEvents ComboBox1 As System.Windows.Forms.ComboBox Friend WithEvents ListBox1 As System.Windows.Forms.ListBox Friend WithEvents Button1 As System.Windows.Forms.Button Friend WithEvents Button2 As System.Windows.Forms.Button Friend WithEvents Button3 As System.Windows.Forms.Button Friend WithEvents GroupBox1 As System.Windows.Forms.GroupBox Private Sub InitializeComponent() Me.Label1 = New System.Windows.Forms.Label Me.RadioButton1 = New System.Windows.Forms.RadioButton Me.RadioButton2 = New System.Windows.Forms.RadioButton Me.RadioButton3 = New System.Windows.Forms.RadioButton Me.CheckBox1 = New System.Windows.Forms.CheckBox Me.CheckBox2 = New System.Windows.Forms.CheckBox Me.CheckBox3 = New System.Windows.Forms.CheckBox Me.Label2 = New System.Windows.Forms.Label Me.TextBox1 = New System.Windows.Forms.TextBox Me.Label3 = New System.Windows.Forms.Label Me.ComboBox1 = New System.Windows.Forms.ComboBox Me.ListBox1 = New System.Windows.Forms.ListBox Me.Button1 = New System.Windows.Forms.Button Me.Button2 = New System.Windows.Forms.Button Me.Button3 = New System.Windows.Forms.Button Me.GroupBox1 = New System.Windows.Forms.GroupBox Me.GroupBox1.SuspendLayout() Me.SuspendLayout() ' 'Label1 ' Me.Label1.Font = New System.Drawing.Font("Microsoft Sans Serif", 20.0!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte)) Me.Label1.Location = New System.Drawing.Point(96, 8) Me.Label1.Name = "Label1" Me.Label1.Size = New System.Drawing.Size(216, 40) Me.Label1.TabIndex = 0 Me.Label1.Text = "Old English Inn" ' 'RadioButton1 ' Me.RadioButton1.Font = New System.Drawing.Font("Microsoft Sans Serif", 9.0!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte)) Me.RadioButton1.Location = New System.Drawing.Point(8, 24) Me.RadioButton1.Name = "RadioButton1" Me.RadioButton1.Size = New System.Drawing.Size(112, 24) Me.RadioButton1.TabIndex = 1 Me.RadioButton1.Text = "Full Size Bed" ' 'RadioButton2 ' Me.RadioButton2.Font = New System.Drawing.Font("Microsoft Sans Serif", 9.0!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte)) Me.RadioButton2.Location = New System.Drawing.Point(8, 88) Me.RadioButton2.Name = "RadioButton2" Me.RadioButton2.Size = New System.Drawing.Size(112, 24) Me.RadioButton2.TabIndex = 2 Me.RadioButton2.Text = "King Size Bed" ' 'RadioButton3 ' Me.RadioButton3.Font = New System.Drawing.Font("Microsoft Sans Serif", 9.0!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte)) Me.RadioButton3.Location = New System.Drawing.Point(8, 56) Me.RadioButton3.Name = "RadioButton3" Me.RadioButton3.Size = New System.Drawing.Size(112, 24) Me.RadioButton3.TabIndex = 3 Me.RadioButton3.Text = "Queen Size Bed" ' 'CheckBox1 ' Me.CheckBox1.Font = New System.Drawing.Font("Microsoft Sans Serif", 9.0!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte)) Me.CheckBox1.Location = New System.Drawing.Point(16, 168) Me.CheckBox1.Name = "CheckBox1" Me.CheckBox1.TabIndex = 4 Me.CheckBox1.Text = "Jacuzzi" ' 'CheckBox2 ' Me.CheckBox2.Font = New System.Drawing.Font("Microsoft Sans Serif", 9.0!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte)) Me.CheckBox2.Location = New System.Drawing.Point(16, 192) Me.CheckBox2.Name = "CheckBox2" Me.CheckBox2.Size = New System.Drawing.Size(104, 40) Me.CheckBox2.TabIndex = 5 Me.CheckBox2.Text = "Continental Breakfast" ' 'CheckBox3 ' Me.CheckBox3.Font = New System.Drawing.Font("Microsoft Sans Serif", 9.0!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte)) Me.CheckBox3.Location = New System.Drawing.Point(16, 232) Me.CheckBox3.Name = "CheckBox3" Me.CheckBox3.Size = New System.Drawing.Size(104, 32) Me.CheckBox3.TabIndex = 6 Me.CheckBox3.Text = "Child's Day Bed" ' 'Label2 ' Me.Label2.Font = New System.Drawing.Font("Microsoft Sans Serif", 12.0!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte)) Me.Label2.Location = New System.Drawing.Point(160, 56) Me.Label2.Name = "Label2" Me.Label2.Size = New System.Drawing.Size(120, 24) Me.Label2.TabIndex = 7 Me.Label2.Text = "Days At Inn" ' 'TextBox1 ' Me.TextBox1.Font = New System.Drawing.Font("Microsoft Sans Serif", 9.0!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte)) Me.TextBox1.Location = New System.Drawing.Point(288, 56) Me.TextBox1.Name = "TextBox1" Me.TextBox1.Size = New System.Drawing.Size(128, 21) Me.TextBox1.TabIndex = 8 Me.TextBox1.Text = "" ' 'Label3 ' Me.Label3.Font = New System.Drawing.Font("Microsoft Sans Serif", 12.0!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte)) Me.Label3.Location = New System.Drawing.Point(160, 88) Me.Label3.Name = "Label3" Me.Label3.Size = New System.Drawing.Size(112, 24) Me.Label3.TabIndex = 9 Me.Label3.Text = "Discount" ' 'ComboBox1 ' Me.ComboBox1.Items.AddRange(New Object() {"None", "AARP", "NEA", "GOV"}) Me.ComboBox1.Location = New System.Drawing.Point(288, 88) Me.ComboBox1.Name = "ComboBox1" Me.ComboBox1.Size = New System.Drawing.Size(121, 28) Me.ComboBox1.TabIndex = 10 Me.ComboBox1.Text = "None" ' 'ListBox1 ' Me.ListBox1.Font = New System.Drawing.Font("Microsoft Sans Serif", 10.0!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte)) Me.ListBox1.ItemHeight = 16 Me.ListBox1.Items.AddRange(New Object() {"Room: ", "Jacuzzi : ", "Continental Breakfast : ", "", "Total Cost : ", "Discount : ", "Final Cost : "}) Me.ListBox1.Location = New System.Drawing.Point(144, 128) Me.ListBox1.Name = "ListBox1" Me.ListBox1.Size = New System.Drawing.Size(264, 148) Me.ListBox1.TabIndex = 11 ' 'Button1 ' Me.Button1.Font = New System.Drawing.Font("Microsoft Sans Serif", 12.0!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte)) Me.Button1.Location = New System.Drawing.Point(8, 288) Me.Button1.Name = "Button1" Me.Button1.Size = New System.Drawing.Size(128, 48) Me.Button1.TabIndex = 12 Me.Button1.Text = "Calculate" ' 'Button2 ' Me.Button2.Font = New System.Drawing.Font("Microsoft Sans Serif", 12.0!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte)) Me.Button2.Location = New System.Drawing.Point(152, 288) Me.Button2.Name = "Button2" Me.Button2.Size = New System.Drawing.Size(120, 48) Me.Button2.TabIndex = 13 Me.Button2.Text = "Reset" ' 'Button3 ' Me.Button3.Font = New System.Drawing.Font("Microsoft Sans Serif", 12.0!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte)) Me.Button3.Location = New System.Drawing.Point(288, 288) Me.Button3.Name = "Button3" Me.Button3.Size = New System.Drawing.Size(120, 48) Me.Button3.TabIndex = 14 Me.Button3.Text = "Close" ' 'GroupBox1 ' Me.GroupBox1.Controls.Add(Me.RadioButton3) Me.GroupBox1.Controls.Add(Me.RadioButton2) Me.GroupBox1.Controls.Add(Me.RadioButton1) Me.GroupBox1.Location = New System.Drawing.Point(8, 40) Me.GroupBox1.Name = "GroupBox1" Me.GroupBox1.Size = New System.Drawing.Size(136, 128) Me.GroupBox1.TabIndex = 15 Me.GroupBox1.TabStop = False ' 'Form1 ' Me.AutoScaleBaseSize = New System.Drawing.Size(8, 19) Me.BackColor = System.Drawing.SystemColors.ActiveBorder Me.ClientSize = New System.Drawing.Size(424, 341) Me.Controls.Add(Me.GroupBox1) Me.Controls.Add(Me.Button3) Me.Controls.Add(Me.Button2) Me.Controls.Add(Me.Button1) Me.Controls.Add(Me.ListBox1) Me.Controls.Add(Me.ComboBox1) Me.Controls.Add(Me.Label3) Me.Controls.Add(Me.TextBox1) Me.Controls.Add(Me.Label2) Me.Controls.Add(Me.CheckBox3) Me.Controls.Add(Me.CheckBox2) Me.Controls.Add(Me.CheckBox1) Me.Controls.Add(Me.Label1) Me.Font = New System.Drawing.Font("Microsoft Sans Serif", 12.0!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte)) Me.Name = "Form1" Me.Text = "Form1" Me.GroupBox1.ResumeLayout(False) Me.ResumeLayout(False) End Sub #End Region Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click Dim days As Double Dim charge As Double Dim addons As Double Dim total As Double Dim discount As Double Dim final As Double Dim Bed As String addons = 0 charge = 100 ListBox1.Items.Clear() If TextBox1.Text = "" Then MessageBox.Show("Please enter length of visit", "missing Information") Exit Sub End If If RadioButton1.Checked = False And RadioButton2.Checked = False And RadioButton3.Checked = False Then MessageBox.Show("Please select Bed Size", "Missing Information") Exit Sub End If days = CDbl(TextBox1.Text) If RadioButton1.Checked = True Then charge = charge + 10 ListBox1.Items.Add("Room with Full Size Bed:" & Format((charge * days), "currency")) End If If RadioButton2.Checked = True Then charge = charge + 30 ListBox1.Items.Add("Room with King Size Bed:" & Format((charge * days), "currency")) End If If RadioButton3.Checked = True Then charge = charge + 20 ListBox1.Items.Add("Room with Queen Size Bed:" & Format((charge * days), "currency")) End If If CheckBox1.Checked = True Then addons = addons + 10 ListBox1.Items.Add("Jacuzzi :" & Format(10, "currency")) End If If CheckBox2.Checked = True Then charge = charge + 20 ListBox1.Items.Add("Continental Breakfast:" & Format((20 * days), "currency")) End If If CheckBox3.Checked = True Then charge = charge + 20 ListBox1.Items.Add("Child's Bed:" & Format(20, "currency")) End If total = (charge * days) + addons If ComboBox1.Text = "None" Then discount = 0 final = total Else discount = total * 0.1 final = total * 0.9 End If ListBox1.Items.Add("") ListBox1.Items.Add("Total Cost :" & Format(total, "currency")) ListBox1.Items.Add("Discount :" & Format(discount, "currency")) ListBox1.Items.Add("Final Cost :" & Format(final, "currency")) End Sub Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click TextBox1.Clear() ListBox1.Items.Clear() ListBox1.Items.Add("Room :") ListBox1.Items.Add("Jacuzzi :") ListBox1.Items.Add("Continental Breakfast :") ListBox1.Items.Add("") ListBox1.Items.Add("Total Cost :") ListBox1.Items.Add("Discount :") ListBox1.Items.Add("Final Cost :") CheckBox1.CheckState = False CheckBox2.CheckState = False CheckBox3.CheckState = False ComboBox1.Text = "None" End Sub Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click Me.Close() End Sub End Class