Posted by Brenda on Sunday, April 17, 2011 at 9:59am.
I’m using VB 2008. I need to
write a simple program that calculates total sales of purchases. The program should accept item costs as input calculate the tax on each item (8%) display the item cost, total cost, and total after taxes. Item costs will be added to a listbox while the total without the taxes will be displayed in a label, the tax amount in another label, and finally, the total cost (items cost + tax) in a third label.
Public Class Form1
Dim strTotal As Double = 0
Private Sub txtItemCost_Enter(ByVal sender As Object, ByVal e As System.EventArgs) Handles txtItemCost.Enter
' select the Item Cost
Private Sub btnAdd_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnAdd.Click
' declare valiables
Dim strTaxAmt As Double
Dim strTotalTax As Double
Dim strItemCost As Double
Dim strTotal As Double
' add items listbox
strItemCost = CDbl(lstItemCosts.Text)
strTotal = strTotal + strItemCost ' add to running total
' calculates totals
strTaxAmount = strTotal * 0.08
strTotalWTax = strTotal + strTaxAmount
txtTotal.Text = strTotal
txtTaxAmount.Text = strTaxAmount
txtTotalWTax.Text = strTotalWTax
' insert a dollar sign as the first character
strTotal = strTotal(0, "$"), "Currency")
strTaxAmount = strTaxAmount(0, "$")
Private Sub btnExit_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnExit.Click
Answer This Question
More Related Questions
- Programming - I’m using VB 2008. I need to write a simple program that ...
- C++ - Write a complete, working program that will do the following: Suppose you ...
- computer science - Write a program that will input an item’s wholesale cost and ...
- java programmin - You have been hired by the local library to build a small ...
- Pseudocode - Produce the algorithm for the problem above [this will include five...
- programming - Create three (3) one-dimensional arrays: Item Number, Quantity-on-...
- math ( CHECK MY WORK) - 1. on 3 tests, a student scored a total of 258 points. ...
- Math :( - Can someone plz explain how to do this math project, Plz give me some ...
- Accounting - Costs can be classified into two categories, fixed and variable ...
- Programming Using Raptor - How do i program this into Raptor Language? print "...