Results 1 to 7 of 7

Thread: Calculating the VAT

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Jan 2014
    Posts
    95

    Calculating the VAT

    I need help working out the VAT of my program.
    Code:
    Console.WriteLine(" The total cost of your expenses with VAT is" & FormatCurrency(cost + cost2 * 0.2))

  2. #2
    WiggleWiggle dclamp's Avatar
    Join Date
    Aug 2006
    Posts
    3,527

    Re: Calculating the VAT

    Based on PEMDAS your math is Multiplying 0.2 with "cost2" and then adding "cost".

    Assuming you are adding the two costs together and then the VAT is 0.2 you will want to do the following:

    Add all costs together:
    subtotal = cost+cost2

    Find the VAT of subtotal:
    vat = subtotal * 0.2

    Add VAT to subtotal:
    total = subtotal + vat

    Apply those steps to your code.

  3. #3
    Fanatic Member TDQWERTY's Avatar
    Join Date
    Oct 2003
    Location
    Oporto & Leiria, Portugal / Luanda, Angola
    Posts
    972

    Re: Calculating the VAT

    Depending on each country this will operate, vat value must be rounded or trimmed.
    Usually you round by 2 decimal places the "liquid total" value.
    ::Winamp 5.xx id3v2 & modern skin support::
    ::NetCF DataGrid Programatically Scroll Example::
    Don't forget to rate posts from those who helped you solving your problem, clicking on and rating it.

  4. #4

    Thread Starter
    Lively Member
    Join Date
    Jan 2014
    Posts
    95

    Re: Calculating the VAT

    Thank you I have worked out the VAT thanks to you

  5. #5

    Thread Starter
    Lively Member
    Join Date
    Jan 2014
    Posts
    95

    Re: Calculating the VAT

    Could you also explain how I should code the program to allow the user to view details that are calculated later in the program. I have made a menu for my program but I don't know how to show details that are coded later on in the program. Basically the VAT rate has to be shown at the begging of the program if the user selects a certain option from my menu
    Last edited by junied32167; Feb 8th, 2014 at 10:50 AM.

  6. #6
    Frenzied Member
    Join Date
    Jan 2009
    Location
    Watch Window(Shift+f9)
    Posts
    1,879

    Re: Calculating the VAT


    Could you also explain how I should code the program to allow the user to view details that are calculated later in the program. I have made a menu for my program but I don't know how to show details that are coded later on in the program. Basically the VAT rate has to be shown at the begging of the program if the user selects a certain option from my menu
    just write the code to the click event of radio button . if specific condition is achieved show the message at the lable1.caption='what you want to show' that is the way to handle the things .
    Code:
    If RadioButton1.Checked = True Then
     
     Method()
     label1.caption='vat rate according to what you want
    
    ElseIf RadioButton2.Checked = True Then
    
     Method2()
    label2.caption="what you want to display'
    End If
    Last edited by firoz.raj; Feb 9th, 2014 at 11:21 AM.

  7. #7

    Thread Starter
    Lively Member
    Join Date
    Jan 2014
    Posts
    95

    Re: Calculating the VAT

    Thank you to all that have helped me with my program.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width