# Simple Payroll.vb

Page 1 of 1

## 3 Replies - 7257 Views - Last Post: 21 September 2012 - 02:36 PMRate Topic: //<![CDATA[ rating = new ipb.rating( 'topic_rate_', { url: 'http://www.dreamincode.net/forums/index.php?app=forums&module=ajax&section=topics&do=rateTopic&t=292757&amp;s=c5f621732cda7fac91baf8c0c19989e9&md5check=' + ipb.vars['secure_hash'], cur_rating: 0, rated: 0, allow_rate: 0, multi_rate: 1, show_rate_text: true } ); //]]>

### #1 TechnoFiction

Reputation: 1
• 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

• Suitor #2

Reputation: 13947
• Posts: 55,683
• 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.

### #3 TechnoFiction

Reputation: 1
• 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

### #4 modi123_1

• Suitor #2

Reputation: 13947
• Posts: 55,683
• 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>

Page 1 of 1

 .related ul { list-style-type: circle; font-size: 12px; font-weight: bold; } .related li { margin-bottom: 5px; background-position: left 7px !important; margin-left: -35px; } .related h2 { font-size: 18px; font-weight: bold; } .related a { color: blue; }