Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

In Exercises 1 through 10, determine the output displayed when the button is cli

ID: 3676631 • Letter: I

Question

In Exercises 1 through 10, determine the output displayed when the button is clicked on. Credit Card Payment Write a program to calculate the balance and minimum payment for a credit card statement. See Fig. 5.27. The program should use the event procedure shown in Fig. 5.28. The finance charge is 1.5 % of the old balance. If the new balance is $20 or less, the minimum payment should be the entire new balance. Otherwise, the minimum payment should be $20 plus 10 % of the amount of the new balance above $20. Private Sub btnCalculateClick(...) Handles btnCalculate.Click Dim oldBalance, charges, credits, newBalance, minPayment As Double InputData(oldBalance, charges, credits) CalculateNewValues(oldBalance, charges, credits, newBalance, minPayment) DisplayData(newBalance, minPayment) End sub

Explanation / Answer

Private Sub btncalculate_Click ( sender As Object , e As EventArgs ) Handles BtnCalculate.Click
Dim oldbalance , charges , credits , newbalance , minpayment As Double

inputdata ( oldbalance , charges , credits )
CalculateNewValues ( oldbalance , charges , credits , newbalance , minpayment )
DisplayData ( newbalance , minpayment )

End Sub

Sub inputdata ( ByRef oldbalance As Double ,ByRef Charges As Double ,ByRef Credits As Double )
oldbalance= CDbl ( txtoldbal.Text )
Charges= CDbl ( txtcharges.Text )
Credits= CDbl ( txtcredits.Text )


End Sub

Sub CalculateNewValues ( ByRef oldbalance As Double ,ByRef Charges As Double ,ByRef Credits As Double ,ByRef newbalance As Double ,ByRef minpayment As Double )

Interest= oldbalance*0.015
newbalance= oldbalance+ Interest- Charges+ credits
If newbalance <20 Then
minpayment= newbalance
End If
If newbalance >20 Then
minpayment= 20+ ( 0.1 *newbalance )
End If
End Sub

Sub DisplayData ( newbalence As Double ,minpay As Double )
txtnewbal.Text= newbalence.ToString
txtminpay.Text= minpay.ToString

End Sub