Public Class Form1 Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click ' get #, compute cost '1. INPUT: get # bagels Dim cost, number As Double number = CDbl(InputBox("Enter number of bagels:")) '2. PROCESS: Compute cost cost = number * 0.6 If (number < 6) Then cost = number * 0.75 End If '3. OUTPUT: show cost Me.TextBox1.Text = "The cost is " & FormatCurrency(cost) End Sub End Class _ Partial Class Form1 Inherits System.Windows.Forms.Form 'Form overrides dispose to clean up the component list. _ Protected Overrides Sub Dispose(ByVal disposing As Boolean) If disposing AndAlso components IsNot Nothing Then components.Dispose() 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. _ Private Sub InitializeComponent() Me.Button1 = New System.Windows.Forms.Button Me.TextBox1 = New System.Windows.Forms.TextBox Me.SuspendLayout() ' 'Button1 ' Me.Button1.BackColor = System.Drawing.Color.FromArgb(CType(CType(61, Byte), Integer), CType(CType(226, Byte), Integer), CType(CType(165, Byte), Integer)) Me.Button1.Font = New System.Drawing.Font("Arial Black", 12.0!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte)) Me.Button1.Location = New System.Drawing.Point(143, 57) Me.Button1.Name = "Button1" Me.Button1.Size = New System.Drawing.Size(144, 73) Me.Button1.TabIndex = 0 Me.Button1.Text = "Bagels" Me.Button1.UseVisualStyleBackColor = False ' 'TextBox1 ' Me.TextBox1.Location = New System.Drawing.Point(143, 176) Me.TextBox1.Name = "TextBox1" Me.TextBox1.Size = New System.Drawing.Size(144, 20) Me.TextBox1.TabIndex = 1 ' 'Form1 ' Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!) Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font Me.BackColor = System.Drawing.SystemColors.ControlText Me.ClientSize = New System.Drawing.Size(442, 290) Me.Controls.Add(Me.TextBox1) Me.Controls.Add(Me.Button1) Me.Name = "Form1" Me.Text = "Form1" Me.ResumeLayout(False) Me.PerformLayout() End Sub Friend WithEvents Button1 As System.Windows.Forms.Button Friend WithEvents TextBox1 As System.Windows.Forms.TextBox End Class