Answer to Question #186911 in Visual Basic for VG MALULEKE GLORY

Question #186911

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.




1
Expert's answer
2021-04-28T16:45:58-0400
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

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS