Menu DEVPPL Search
157.891
MEMBERS
15.939
TOPICS
63.222
POSTS
  562
FLASH GAMES
7.717
TUTORIALS
 

Login

E-mail:
Password:

I need help

0

Loading

I need help

Postby Throwdoffbabygurl » Wed Jul 07, 2010 11:41 pm

I am currently working on a VB project for creating a weekly pay calculator (Dont worry, this is for a school assignment, not the real deal.. :0)) I cant seam to figure out what i'm doing wrong in my code. I finally got rid of all of the error's i was getting but now it just wont give me a figure other then 0 for Hours worked, Left over minutes, or weekly pay no matter what I put in the text box's for minutes worked and rate of pay. I'm assuming it is something wrong with my code to divide my minutes by 60 and multiply by the amount of hours to get the proper outcome. Everything else works other then the main purpose of the whole creation. If someone can help me it would be greatly appreciated. Here is my programing code i have:

Public Class frmWeeklyPayCalculater

Const cintNumberOfMinutesInHour As Decimal = 60D

Private Sub btnWeeklyPay_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnWeeklyPay.Click

Dim inttxtMinutesWorked As Integer
Dim strtxtMinutesWorked As String
Dim dectxtMinutesWorked As Decimal
Dim dectxtPayRate As Decimal
Dim intlblHoursWorked As Integer
Dim intlblMinutesLeft As Integer
Dim declblWeeklyPay As Decimal

strtxtMinutesWorked = Me.txtMinutesWorked.Text
dectxtMinutesWorked = dectxtMinutesWorked \ 60
intlblHoursWorked = inttxtMinutesWorked \ 60
intlblHoursWorked = intlblHoursWorked Mod 60
declblWeeklyPay = Convert.ToDecimal(inttxtMinutesWorked) / Convert.ToDecimal(cintNumberOfMinutesInHour) * dectxtPayRate
Me.lblHoursWorked.Text = intlblHoursWorked.ToString("G")
Me.lblLeftOverMinutesWorked.Text = intlblMinutesLeft.ToString("G")
Me.lblWeeklyPay.Text = declblWeeklyPay.ToString("C")

End Sub

Private Sub btnClear_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnClear.Click

Me.txtMinutesWorked.Clear()
Me.txtPayRate.Clear()
Me.lblLeftOverMinutesWorked.Text = ""
Me.lblHoursWorked.Text = ""
Me.lblWeeklyPay.Text = ""

End Sub

Private Sub frmWeeklyPayCalculater_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load

Me.txtMinutesWorked.Clear()
Me.txtPayRate.Clear()
Me.lblLeftOverMinutesWorked.Text = ""
Me.lblHoursWorked.Text = ""
Me.lblWeeklyPay.Text = ""

End Sub

Private Sub btnExit_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnExit.Click

' close the window and terminate the application

Me.Close()

End Sub

End Class
Throwdoffbabygurl
 
Reputation: 0
Posts: 1
Joined: Wed Jul 07, 2010 11:31 pm
Highscores: 0
Arcade winning challenges: 0

I need help - Sponsored results

Sponsored results

Login to get rid of ads

 

^ Back to Top