Pele needs a program to calculate his bank balance at the end of the month. Get his balance at the beginning of the month and his deposit and withdrawal amounts during the month. Bank costs are fixed at R55.66 per month. Calculate and display his balance at the end of the month.
Select the best variable name for the balance at the beginning of the month.
Public Class mainForm
''' <summary>
''' Calculate button
''' </summary>
''' <param name="sender"></param>
''' <param name="e"></param>
''' <remarks></remarks>
Private Sub btnCalculate_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnCalculate.Click
'Bank costs are fixed at R55.66 per month.
Dim BANK_COST As Double = 55.66D
Dim balance As Double = Double.Parse(txtBalance.Text)
Dim depositAmont As Double = Double.Parse(txtDepositAmont.Text)
Dim withdrawalAmont As Double = Double.Parse(txtWithdrawalAmont.Text)
Dim bankBalanceEndMonth As Double = balance + depositAmont - withdrawalAmont - BANK_COST
txtBankBalance.Text = "R" + bankBalanceEndMonth.ToString("N2")
End Sub
End Class
Comments
Leave a comment