How income taxes work in Canada

Discussion in 'Wars' started by *LR_DOCTORPINKZ_LR (01), Oct 6, 2013.

  1. 'Declare the constants and variables.

    Const EXEMPTION = 1623.3
    Const ONTARIO_TAX_PERCENT = 0.42

    Dim Income As Double
    Dim FederalTaxes As Double
    Dim OntarioTaxes As Double
    Dim TotalTaxes As Double

    'Prompt the user for the income.

    Income = Val(txtIncome.Text)

    'Calculate the taxes.

    If Income <= 42707 Then
    FederalTaxes = Income * 0.15
    ElseIf Income <= 85414 Then
    FederalTaxes = 6406 + ((Income - 42707) * 0.22)
    ElseIf Income <= 132406 Then
    FederalTaxes = 15802 + ((Income - 85414) * 0.26)
    Else
    FederalTaxes = 28020 + ((Income - 132406) * 0.29)
    End If

    If FederalTaxes < EXEMPTION Then
    FederalTaxes = 0
    Else
    FederalTaxes = FederalTaxes - EXEMPTION
    End If

    OntarioTaxes = FederalTaxes * ONTARIO_TAX_PERCENT
    TotalTaxes = FederalTaxes + OntarioTaxes

    'Determine if the results are legal and display the results

    If Income < 0 Then
    lblFederalTax.Caption = "Invalid Input!"
    lblOntarioTax.Caption = "Invalid Input!"
    lblTotalTax.Caption = "Invalid Input!"
    txtIncome.Text = "Invalid Input!"
    Else
    lblFederalTax.Caption = Format$(FederalTaxes, "Currency")
    lblOntarioTax.Caption = Format$(OntarioTaxes, "currency")
    lblTotalTax.Caption = Format$(TotalTaxes, "currency")
    txtIncome.Text = Format$(Income, "currency")
    End If
     
  2. This is in a weird format...looks like Copy and paste.
     
  3. Seems legit
     
  4. At least he is spamming informational stuff now. Inb4 /lock
     
  5. the codes that have " ' " are comments. in other words they are the algorithm for the program.
     
  6. Visual Basic Format and something that I understand. :lol: :lol:
     
  7. Vb ftw 
     
  8. You're joking, right?

    You're in the wrong category.
    Ask a mod to change this to OFF TOPIC from WAR section