Question
Could someone translate this vb code to structure english? (i.e declare mailbox, call procedure, etc) Private Sub btnCalc_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)
Could someone translate this vb code to structure english? (i.e declare mailbox, call procedure, etc)
Private Sub btnCalc_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnCalc.Click 'Declare the required variables Dim currentbal, withdrawal, newbal As Double Get the input of number of "current balance and "withdrawal amount in string type and then convert the amount into double data type. 'read the input from user currentbal = CDbl(InputBox("Enter the current balance")) withdrawal = CDbl(InputBox("Enter the withdrawal amount")) Check whether the withdrawal amount is greater than current balance amount. If the condition is true, then display the error message 'If the withdrawal amount is greater than current 'balance amount If withdrawal > currentbal Then 'Display the message MessageBox.Show ("withdrawal denied") If the withdrawal amount is less than current balance amount then calculate the new balance amount by subtracting the withdrawal amount from current balance amount. 'If the withdrawal amount is less than current balance amount. Else 'Subtract the withdrawal amount from current 'balance newbal = currentbal - withdrawal Convert the new balance amount into double data type and then print the new balance in text box. 'Display the new balance in double data type txtBal.Text = CDbl(newbal) If the new balance amount is less than 150 then display the message. 'If the new balance is less than 150 If newbal < 150 Then 'Display the message MessageBox.Show("Balance below $150") End If End If End Sub
Private Sub btnExit_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnExit.Click End the application 'Close the form Me.Close() End Sub End Class
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started