2 Replies - 6935 Views - Last Post: 27 March 2009 - 08:43 AM Rate Topic: -----

#1 lzoulek   User is offline

  • New D.I.C Head

Reputation: 1
  • View blog
  • Posts: 15
  • Joined: 19-October 08

Someone please help me! vb weekly pay calculator

Post icon  Posted 27 March 2009 - 08:24 AM

Please help me someone!!
I have this homework assignment where we have to create a pay calculator where you would enter the total minutes worked and the hourly pay rate. and then i have to create the code to show what the total weekly pay would be. I have to display the Hours Worked: and the Leftover minutes: I also know that the formula to calculate the weekly pay is totalMinutesWorked / 60 = hoursWorked and i have to use the Mod operator, but I cant figure out what I am doing wrong. If anyone can look at my code below and help me out I would really appreciate it.

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

		Dim strNumberOfMinutes As String
		Dim intNumberOfMinutes As Integer
		Dim strPayRate As String
		Dim decPayRate As Decimal
		Dim decTotalWeeklyPay As Decimal
		Dim intHoursWorked As Integer
		Dim intLeftoverMinutes As Integer
		Dim decLeftoverMinutes As Decimal
		Dim intTotalMinutesWorked As Integer

		strNumberOfMinutes = Me.txtTotalMinutesWorked.Text
		intNumberOfMinutes = Convert.ToInt32(strNumberOfMinutes)
		strPayRate = Me.txtHourlyPayRate.Text
		decPayRate = Convert.ToDecimal(strPayRate)
		intHoursWorked = intNumberOfMinutes \ 60
		intTotalMinutesWorked = Convert.ToInt32(txtTotalMinutesWorked)
		txtTotalMinutesWorked Mod 60 = intHoursWorked
		decTotalWeeklyPay = decLeftoverMinutes + intHoursWorked * decPayRate
		Me.lblTotalWeeklyPay.Text = decTotalWeeklyPay.ToString("C")

		Me.lblHeadingHoursWorked.Visible = True
		Me.lblHeadingLeftoverMinutes.Visible = True
		Me.lblWeeklyPay.Visible = True
		Me.lblTotalWeeklyPay.Visible = True
		Me.lblHoursWorked.Visible = True
		Me.lblLeftoverMinutes.Visible = True



Is This A Good Question/Topic? 1
  • +

Replies To: Someone please help me! vb weekly pay calculator

#2 PsychoCoder   User is offline

  • Google.Sucks.Init(true);
  • member icon

Reputation: 1659
  • View blog
  • Posts: 19,853
  • Joined: 26-July 07

Re: Someone please help me! vb weekly pay calculator

Posted 27 March 2009 - 08:37 AM

Moved to VB.NET :)
Was This Post Helpful? 0
  • +
  • -

#3 ccubed   User is offline

  • It's That Guy
  • member icon

Reputation: 164
  • View blog
  • Posts: 1,416
  • Joined: 13-June 08

Re: Someone please help me! vb weekly pay calculator

Posted 27 March 2009 - 08:43 AM

txtTotalMinutesWorked Mod 60 = intHoursWorked



Do you mean intTotalMinutesWorked here?
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1