Loading

calculating salary

Submitted by: 


'hi i'm having problem with calcolating the total it gives me zero
' can any one help me with that

Private Sub Button12_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button12.Click
Dim advanced As Double
Dim benefit As Double
Dim basic As Double
Dim hra As Double
Dim med_all As Double
Dim child As Double
Dim hma As Double
Dim total As Double

advanced = Convert.ToDouble(TextBox6.Text)
benefit = Convert.ToDouble(TextBox7.Text)
basic = Convert.ToDouble(TextBox8.Text)
hra = Convert.ToDouble(TextBox9.Text)
med_all = Convert.ToDouble(TextBox10.Text)
child = Convert.ToDouble(TextBox11.Text)
hma = Convert.ToDouble(TextBox12.Text)
total = Convert.ToDouble(TextBox13.Text)

TextBox6.Text = advanced.ToString
TextBox7.Text = benefit.ToString
TextBox8.Text = basic.ToString
TextBox9.Text = hra.ToString
TextBox10.Text = med_all.ToString
TextBox11.Text = child.ToString
TextBox12.Text = hma.ToString
TextBox13.Text = total.ToString

hra = hra * 5 / 100 * 100
med_all = med_all * 5 / 100 * 100
child = child * 5 / 100 * 100
hma = hma * 8 / 100 * 100
total = basic + advanced + benefit + hra + med_all + child + hma

End Sub



admin's picture

Did you try to use the debugger of VB.NET? Press F8 when you run your project so that you'll see the value in every variables.

Add new comment

Filtered HTML

  • You may insert videos with [video:URL]
  • You can enable syntax highlighting of source code with the following tags: <code>, <blockcode>, <asp>, <c>, <cpp>, <csharp>, <css>, <html4strict>, <java>, <javascript>, <mysql>, <php>, <python>, <sql>, <vb>, <vbnet>. The supported tag styles are: <foo>, [foo].
  • Lines and paragraphs break automatically.

Plain text

  • No HTML tags allowed.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Lines and paragraphs break automatically.