visual basic.... help....I have a program that i have to write, Im done with eve
ID: 3676706 • Letter: V
Question
visual basic.... help....I have a program that i have to write, Im done with everything beside this.. I have to be able to click on 3 check boxes and they add.. here is the code for this part , when i click 1 check box the answer come up right but when i click two i get nothing.,, memfees is a diff part of the program
Dim yoga As Double = 20
Dim kar As Double = 30
Dim trainer As Double = 50
If chkKar.Checked = True Then
txtFees = memFees * kar
End If
If chkPerTrain.Checked = true Then
txtFees = memFees * trainer
End If
If chkYoga.Checked Then txtFees = memFees * yoga
End If
txtBoxFees.Text = txtFees.ToString("C")
Explanation / Answer
Here is the modified code as per your requirements.
Dim yoga As Double = 20
Dim kar As Double = 30
Dim trainer As Double = 50
Dim C as Double
If chkKar.Checked = True Then
C= memFees * kar
End If
If chkPerTrain.Checked = True Then
C = memFees * trainer
End If
If chkYoga.Checked = True Then
C = memFees * yoga
End If
txtBoxFees.Text = str(C)
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.