Visual basic - Bank Balance

Anthony

New Member
Reaction score
0
Public Class frmExQ6
' Compute Bank Balance
' by <Your Name>
' compiled using MS Visual Studio 2010
' tested on an Intel Xeon PC running MS Windows 7
' CS 115 Section <A or D>
' May 17, 2013
' This program will compute the bank balance after subtracting the total of 5 bills
' starting with a $2000 balance.


Private Sub btnGo_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnGo.Click
Const dblBEGINNING_BALANCE As Double = 2000.0 'Beginning balance
Dim dblTotBills As Double = 0.0 'Total of bills
Dim dblBalance As Double 'Balance = beginning balance - total of bills

AddBillsToList() 'Add bills to the List Box
ComputeBillTotal(dblTotBills) 'Compute total of bills
dblBalance = ____________________ - ___________ 'Compute the balance
lblOut.Text = dblBalance.ToString("c") 'Display balance in label as currency



End Sub

Private Sub AddBillsToList()
'-----------------------------
'Procedure to Add bills to the List Box
'-----------------------------
Dim intCount As Integer 'For Loop Counter
Dim strValue As String 'Storage for input

ClearAll() 'Clear list box and total
'-----------------------------
' For loop to add 5 items to List Box
'-----------------------------
For ______________________
strValue = InputBox("Enter amount for Bill " & intCount + 1, "Bill Entry")
'-----------------------------
'edit input - ensure value is numeric
'-----------------------------
If ___________________ Then 'If input is numeric
lstBills.Items.___(strValue) 'Add value to List Box
Else
MessageBox.Show("Please enter a numeric value")
intCount -= 1 'Set counter down for re-entry at same spot
End If

Next
End Sub
Private Sub ComputeBillTotal(By___ dblVal As Double)
'-----------------------------
'Procedure to total the bills -
'parameter must be passed "By____" so original value passed is changed
'-----------------------------
Dim intX As Integer = 0 'Counter for Do While Loop

Do __________________________________ 'Do loop
dblVal += CDbl(lstBills.___________) 'Convert list box entry to double and add to total
intX += 1 'Increment counter
Loop

End Sub

Private Sub ClearAll()
'-----------------------------
'Procedure to clear List Box and Label
'-----------------------------
lstBills.Items.________() 'Clear List Box
lblOut.Text = String.________ 'Clear Output Label

End Sub
Private Sub btnExit_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnExit.Click
Me.Close()
End Sub
End Class
 

The Helper

Necromancy Power over 9000
Staff member
Reaction score
1,697
Is there a question here or are you just donating code? Also what is with the big

______________________

in the code all over the place? Copypasta error?
 

camelCase

The Case of the Mysterious Camel.
Reaction score
362
Visual Basic has got to be the ugliest code in existence =(
I don't understand any of this code =(
(Logical fallacies ftw)
 

s3rius

Linux is only free if your time is worthless.
Reaction score
130
It's "fill in the blanks".
Probably homework or something.

I'm not going to bother, since the OP doesn't seem to want to invest more work than copy pasta.
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Members online

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top