3 Replies - 2668 Views - Last Post: 21 September 2012 - 02:36 PM Rate Topic: -----

#1 TechnoFiction  Icon User is offline

  • D.I.C Head

Reputation: 1
  • View blog
  • Posts: 68
  • Joined: 21-September 12

Simple Payroll.vb

Posted 21 September 2012 - 02:22 PM

' This program calculates an employee's take-home pay. 
Option Explicit On
Option Strict On
Module Payroll
   Sub Main()
      Dim salary As Double = 950.00
      Dim stateTax As Double = 0.06
      Dim federalTax As Double = 0.25
      Dim numDependents As Integer = 3
      Dim dependentDeduction As Double = 0.02
      Dim totalWithholding As Double = 
      Dim takeHomePay As Double = 

      ' Calculate state tax here

      System.Console.WriteLine("State Tax: $" & stateTax)
      ' Calculate federal tax here 

      System.Console.WriteLine("Federal Tax: $" & federalTax)
      ' Calculate dependant deduction here

      System.Console.WriteLine("Dependents: $" & dependentDeduction)
      ' Calculate total withholding here

      ' Calculate take home pay here

      System.Console.WriteLine("Salary: $" & salary)
      System.Console.WriteLine("Take-Home Pay: $" & takeHomePay)
   End Sub
End Module

This is what it telling me to do:
Calculate state withholding tax at 6.0%, and calculate federal withholding tax at 25.0%.
Calculate dependent deductions at 2.0% of the employee's salary for each dependent.
Calculate total withholding.
Calculate take-home pay as salary minus total withholding plus deductions.

Can you guys check to see if I'm putting number in right. And what code I'm missing to make it work

Is This A Good Question/Topic? 0
  • +

Replies To: Simple Payroll.vb

#2 modi123_1  Icon User is online

  • Suitor #2
  • member icon



Reputation: 9494
  • View blog
  • Posts: 35,842
  • Joined: 12-June 08

Re: Simple Payroll.vb

Posted 21 September 2012 - 02:26 PM

Sorry we will not do your homework for you. On the other hand if you have specific questions we can help with that.
Was This Post Helpful? 0
  • +
  • -

#3 TechnoFiction  Icon User is offline

  • D.I.C Head

Reputation: 1
  • View blog
  • Posts: 68
  • Joined: 21-September 12

Re: Simple Payroll.vb

Posted 21 September 2012 - 02:32 PM

No, I'm not tell you to do for me, just check? Is that in category of doing homework for someone too.
If I'm wrong somewhere, just point it out and don't give the answer.
Sorry, if I'm violate the rule
Was This Post Helpful? 0
  • +
  • -

#4 modi123_1  Icon User is online

  • Suitor #2
  • member icon



Reputation: 9494
  • View blog
  • Posts: 35,842
  • Joined: 12-June 08

Re: Simple Payroll.vb

Posted 21 September 2012 - 02:36 PM

Okay.. well I don't see where you are doing any math. Where you have commented "Calculate state tax here" - where is your math?

<variable1 name> = <variable2 name> * <variable3 name>
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1