Computer Science Homework Solutions
Problem
#129506

Visual Basic Classes

Write a program to implement a cash register. The program should have a class named Cash Register that keeps track of the balance money and allows deposits and withdrawals. The class should call an event when a negative balance is made.

Attached file(s):
Attachments
example.txt  View File

Attachment Content Summary (Note: view attachment at the above link before purchasing. Actual attachment content may vary slightly from that shown below.)

example.txt
Visual Basic Copy Code


Class bankAccount
Shared interestRate As Decimal
Private accountNumber As String
Private accountBalance As Decimal
Public holdOnAccount As Boolean = False



Public ReadOnly Property balance() As Decimal
Get
Return accountBalance
End Get
End Property



Public Sub postInterest()
accountBalance = accountBalance * (1 + interestRate)
End Sub



Public Sub postDeposit(ByVal amountIn As Decimal)
accountBalance = accountBalance + amountIn
End Sub



Public Sub postWithdrawal(ByVal amountOut As Decimal)
accountBalance = accountBalance - amountOut
End Sub
Solution
What is this?
By OTA - Overall OTA Rating
Purchase Cost Now
$2.19 CAD (was ~$19.95)
Included in Download
  • Plain text response
  • Attached file(s):
    • CashRegister.zip
$2.19 Instant Download
Add to Cart
Why you can trust BrainMass.com
  • Your Information is Secure
  • Best Online Academic Help Service
  • Students find real academic Success
Related Solutions
Browse