Option Explicit On 
Option Strict On

Public Class frmPrice
  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
  Friend WithEvents Label1 As System.Windows.Forms.Label
  Friend WithEvents Label2 As System.Windows.Forms.Label
  Friend WithEvents txtTemp As System.Windows.Forms.TextBox
  Friend WithEvents txtPrice As System.Windows.Forms.TextBox
  Friend WithEvents btnPrice As System.Windows.Forms.Button

  'Required by the Windows Form Designer
  Private components As System.ComponentModel.Container

  '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.
  <System.Diagnostics.DebuggerStepThrough()> Private Sub InitializeComponent()
    Me.Label1 = New System.Windows.Forms.Label()
    Me.Label2 = New System.Windows.Forms.Label()
    Me.txtPrice = New System.Windows.Forms.TextBox()
    Me.btnPrice = New System.Windows.Forms.Button()
    Me.txtTemp = New System.Windows.Forms.TextBox()
    Me.SuspendLayout()
    '
    'Label1
    '
    Me.Label1.Location = New System.Drawing.Point(8, 16)
    Me.Label1.Name = "Label1"
    Me.Label1.TabIndex = 0
    Me.Label1.Text = "Temperature"
    '
    'Label2
    '
    Me.Label2.Location = New System.Drawing.Point(8, 56)
    Me.Label2.Name = "Label2"
    Me.Label2.TabIndex = 1
    Me.Label2.Text = "Price"
    '
    'txtPrice
    '
    Me.txtPrice.Location = New System.Drawing.Point(112, 48)
    Me.txtPrice.Name = "txtPrice"
    Me.txtPrice.TabIndex = 3
    Me.txtPrice.Text = ""
    '
    'btnPrice
    '
    Me.btnPrice.Location = New System.Drawing.Point(80, 88)
    Me.btnPrice.Name = "btnPrice"
    Me.btnPrice.TabIndex = 4
    Me.btnPrice.Text = "&Set Price"
    '
    'txtTemp
    '
    Me.txtTemp.Location = New System.Drawing.Point(112, 16)
    Me.txtTemp.Name = "txtTemp"
    Me.txtTemp.TabIndex = 2
    Me.txtTemp.Text = ""
    '
    'frmPrice
    '
    Me.AutoScaleBaseSize = New System.Drawing.Size(5, 13)
    Me.ClientSize = New System.Drawing.Size(236, 137)
    Me.Controls.AddRange(New System.Windows.Forms.Control() {Me.btnPrice, Me.txtPrice, Me.txtTemp, Me.Label2, Me.Label1})
    Me.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle
    Me.Name = "frmPrice"
    Me.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen
    Me.Text = "Price Problem"
    Me.ResumeLayout(False)

  End Sub

#End Region

  Private Sub btnPrice_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnPrice.Click
    Dim Temperature As Integer
    Dim Price As Integer
    Temperature = CInt(Val(txtTemp.Text))
    Select Case Temperature
      Case Is < 50
        Price = 0
      Case 50 To 60
        Price = 20
      Case 61 To 70
        Price = 25
      Case 71 To 80
        Price = 30
      Case 81 To 85
        Price = 40
      Case 86 To 90
        Price = 50
      Case 91 To 95
        Price = 55
      Case 96 To 100
        Price = 65
      Case Else
        Price = 75
    End Select
    If Price <> 0 Then
      txtPrice.Text = Str(Price) & " Cents"
    Else
      txtPrice.Text = "Don't Bother!"
    End If
  End Sub
End Class
