Write a program to calculate the balance and the minimum payment for a credit ca
ID: 444568 • Letter: W
Question
Write a program to calculate the balance and the minimum payment for a credit card statement. The grogram should use the event procedure shown below. The finance charge is 1.5% of the old balnce. 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 about $20.
private sub btncalculate_cick(...) handles btncalculate.click
dim old balance, charges, credits, newbalance, minpayment as double
inputdata(oldbalance, charges, credits)
calculateNewValues(oldbaance, charges, credits, newbalance, minpayment)
displaydata(newbalance, minpayment)
Explanation / Answer
Private Sub btnCalcBal_Paymt_Click(sender As Object, e As EventArgs) Handles btnCalcBal_Paymt.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(oldBalance As Double, charges As Double, credits As Double) oldBalance = CDbl(txtOldBal.Text) charges = CDbl(txtCharges.Text) credits = CDbl(txtCredits.Text) End Sub Function CalculateNewValues(oldBalance As Double, newBalance As Double, minPayment As Double, charges As Double, credits As Double) As Double Dim rate As Double = 1.015 newBalance = (rate * oldBalance) + charges - credits Return newBalance If newBalanceRelated Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.