How would I add a 2% sales tax and a $5 shipping charge to the total price?
-
How would I add a 2% sales tax and a $5 shipping charge to the total price(Don't charge sales tax on the shipping) -Visual Basic . How would the code look and where would I put the code at Option Explicit On Option Strict On Option Infer Off ' Project name: Moonbucks Project ' Project Purpose: Calculates the total pounds of coffee ' ordered and the total price ' Created/revised by: <Aswad Burnett> on <Feburary 12,2012> Public Class MainForm Private Sub exitButton_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles exitButton.Click Me.Close() End Sub Private Sub printButton_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles printButton.Click PrintForm1.PrintAction = Printing.PrintAction.PrintToPreview PrintForm1.Print() End Sub Private Sub MainForm_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load End Sub Private Sub clearButton_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles clearButton.Click ' prepares the screen for the next order nameTextBox.Text = String.Empty addressTextBox.Text = String.Empty cityTextBox.Text = String.Empty stateTextBox.Text = String.Empty zipTextBox.Text = String.Empty regularTextBox.Text = String.Empty decafTextBox.Text = String.Empty totalPoundsLabel.Text = String.Empty totalPriceLabel.Text = String.Empty nameTextBox.Focus() End Sub Private Sub calcButton_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles calcButton.Click ' calculates total pounds ordered and total price ' declare constant and variables Const PricePerPound As Double = 11.15 Dim regularCoffee As Integer Dim decafCoffee As Integer Dim totalPounds As Integer Dim totalPrice As Integer ' assign input to variables Integer.TryParse(regularTextBox.Text, regularCoffee) Integer.TryParse(decafTextBox.Text, decafCoffee) ' perform calculations totalPounds = regularCoffee + decafCoffee totalPrice = CInt(totalPounds * PricePerPound) ' display calculated results totalPoundsLabel.Text = Convert.ToString(totalPounds) totalPriceLabel.Text = totalPrice.ToString("C2") clearButton.Focus() End Sub End Class
-
Answer:
Looks like totalPrice contains your total that you want to add tax to, right? If so you can do something like grandTotal = ((totalPrice *1.02) + 5).ToString("c2")
Asburnet... at Yahoo! Answers Visit the source
Other answers
totalPrice = totalPounds * PricePerPound * 1.02 + 5 And you could use it any time after you got the pounds.
How would I Know
Related Q & A:
- How can I prepare a monthly sales report?Best solution by auctivacommerce.com
- How can I become a better sales person?Best solution by Yahoo! Answers
- How can I add a clickable link to a question or answer on yahoo?Best solution by Yahoo! Answers
- How can I add a picture to a video?Best solution by Answerbag.com
- How do I add a photo to a Wikipedia page?Best solution by en.wikipedia.org
Just Added Q & A:
- How many active mobile subscribers are there in China?Best solution by Quora
- How to find the right vacation?Best solution by bookit.com
- How To Make Your Own Primer?Best solution by thekrazycouponlady.com
- How do you get the domain & range?Best solution by ChaCha
- How do you open pop up blockers?Best solution by Yahoo! Answers
For every problem there is a solution! Proved by Solucija.
-
Got an issue and looking for advice?
-
Ask Solucija to search every corner of the Web for help.
-
Get workable solutions and helpful tips in a moment.
Just ask Solucija about an issue you face and immediately get a list of ready solutions, answers and tips from other Internet users. We always provide the most suitable and complete answer to your question at the top, along with a few good alternatives below.