Advertisement
stefan1919

computeTip

Sep 30th, 2015
101
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. Public Class Form1
  2.  
  3.     Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
  4.         Dim sum As Double
  5.         sum = CDbl(TextBox1.Text)
  6.         If sum > 0 Then
  7.             Dim tip As Double
  8.             tip = sum * 0.1
  9.             TextBox2.Text = CStr(tip)
  10.         Else
  11.             MessageBox.Show("Invalid Input")
  12.         End If
  13.  
  14.     End Sub
  15. End Class
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement