Click here to Skip to main content
15,914,327 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:

good afternoon plze answer this qus.

calculate net salary by using selectcase

when case1 salary >=50000 and tax=.05

case2 salary>40000and<50000 and tax=.04

case 3 salary >30000and<40000 and tax=.03

otherwise tax=.00

Posted

1 solution

without doing your homework for you.......this is the jist of what is required;

VB
Private Function calcSalary(ByVal salary As Single) As Single
    Dim tax As Single = 0
    Dim output As Single

    Select Case salary
        Case (salary >= 1000)
            tax = 0.1
        Case ((salary > 2000) And (salary < 3000))
            tax = 0.2
        Case Else
            tax = 0.3
    End Select
    'do calc here
    Return output 'answer
End Function
 
Share this answer
 
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900