English Deutsch Français Italiano Español Português 繁體中文 Bahasa Indonesia Tiếng Việt ภาษาไทย
All categories

Suppose you have a button, cmdCompute, and two text boxes, txtInput and txtOutput. Write code so the user can enter an “income” value in txtInput and the resulting tax is displayed in txtOutput. Compute the tax using this system:
a.Income of $10000 or less is taxed at a simple 15% rate.
b.Income of more than $10000 is tax at 15% for the first $10000 and 25% of the income in excess of $10000.

2006-12-12 05:30:51 · 3 answers · asked by bhs00 2 in Computers & Internet Programming & Design

3 answers

if val(txtinput.text) <= 10000 then
taxvar = .15
else
taxvar = .25
endif

taxtotal = val(txtinput.text) * taxvar

2006-12-12 05:34:49 · answer #1 · answered by Yoi_55 7 · 0 0

Private Sub cmdCompute_Click()

Dim difvar
Dim thetax
Dim chumpchange
chumpchange = 10000 * .15

difvar=val(txtInput.Text)

If difvar<=10000 Then thetax=difvar*.15
If difvar>10000 Then thetax= ((difvar-10000)*.25) + chumpchange
txtOutput.Text=difvar

End Sub



Or something like that.

2006-12-12 13:51:29 · answer #2 · answered by DimensionalStryder 4 · 0 0

Do your own homework slacker!!!

2006-12-12 14:31:03 · answer #3 · answered by Doug B 3 · 0 1

fedest.com, questions and answers