For the following segment of my code I have a text box for entering codes (txtCo
ID: 3902395 • Letter: F
Question
For the following segment of my code I have a text box for entering codes (txtCode.Text) and for entering minutes (txtMinutes.Text) Also I have a discount percent that I need to apply if the radYoung it checked. I need the formula to apply the percent discount.
Const dblSLOW As Double = 0.5 (code 200cc)
Const dblMEDIUM As Double = 1
Const dblFAST As Double = 1.5
Const dblYOUNG As Double = 0.1 (10% discount)
Dim dblTotal As Double
Dim strCode As String I'm stuck in the following formula:
dblTotal = dblSLOW * txtMinutes.Text * dblYOUNG - dblTotal (doesn't work). I need the right formula
Explanation / Answer
Below is the solution:
Const dblSLOW As Double = 0.5
Const dblMEDIUM As Double = 1
Const dblFAST As Double = 1.5
Const dblYOUNG As Double = 0.1
Dim dblTotal As Double
Dim strCode As String 'I'm stuck in the following formula:
If chkradYoung.Checked = True Then 'if statement if the radYoung checkbox is checked then 10% discount
dblTotal = dblSLOW * txtMinutes.Text * dblYOUNG - dblTotal
End If
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.