-
Feb 8th, 2014, 09:23 AM
#1
Thread Starter
Lively Member
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))
-
Feb 8th, 2014, 10:13 AM
#2
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.
-
Feb 8th, 2014, 10:33 AM
#3
Fanatic Member
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.
-
Feb 8th, 2014, 10:37 AM
#4
Thread Starter
Lively Member
Re: Calculating the VAT
Thank you I have worked out the VAT thanks to you
-
Feb 8th, 2014, 10:38 AM
#5
Thread Starter
Lively Member
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.
-
Feb 9th, 2014, 11:13 AM
#6
Frenzied Member
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.
-
Mar 20th, 2014, 10:38 AM
#7
Thread Starter
Lively Member
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
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|