Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Hello, I would appreciate a step by step explanation on how I can complete this

ID: 3628140 • Letter: H

Question

Hello,

I would appreciate a step by step explanation on how I can complete this final project. I need to make sure to include everything listed below. I have no problem awarding bonus points. Please provide a picture of your screen so that I can have an example of what I need to complete. This is not due for another 5 days. Please feel free to email me with any questions.

Here is the assignment:

"Write a program to maintain a person’s Savings and Checking accounts. The program should keep track of and display the balances in both accounts, and maintain a list of transactions (deposits, withdrawals, fund transfers, and check clearings) separately for each account. The two lists of transactions should be stored in sequential files so that they will persist between program sessions.

frmBank.vb will be the form for this program. It will use instances from the other classes that are part of this program. Two drop-down combo boxes should each contain the items Checking and Savings (checking account and a savings account will be instances of class Account in the frmBank.vb,. Each of the four group boxes corresponds to a type of transaction. (When Savings is selected in the Account combo box, the Check group box should disappear.) The user makes a transaction by typing data into the text boxes of a group box and pressing the button. The items appearing in the Transactions list box should correspond to the type of account that has been selected.

The program should use two classes, Transaction and Account. The class Transaction should have properties for transaction name, amount, date and whether it is a credit (deposit) or debit (withdrawal/check). Ensure that these classes are in separate files consistent with best practices (you will have Account.vb and Transaction.vb files in addition to the frmBank.vb file).

The class Account, should use an array of Transaction objects. In addition, it should have properties for name (Checkings or Savings) and balance. It should have methods to carry out a transaction, to display the list of transactions, and to load and retrieve the set of transactions into or from the sequential file. The event InsufficientFunds and TransactionCommitted should be triggered at appropriate times. The value of CStr(Today) is a string giving the current date".

Thank you so much!

Explanation / Answer

Public Class Form3 'load contents of Text file into the listbox when first loaded 'store data in file into array of accounts, record no. counts WithEvents acc1 As New Account Dim ac(0) As Account Dim count As Integer = 0 Dim curDateTime As String = CStr(Now) Dim cBal As Double, sBal As Double 'stores the latest balances from both accounts Dim flag As Boolean = False 'changes to true if "check if balance is below 0" Private Sub Form3_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load acc1 = New Account 'acc1.fileControl("Open", ac, acc1, count) GroupBox2.Enabled = False GroupBox3.Enabled = False GroupBox4.Enabled = False GroupBox5.Enabled = False Button1.Enabled = False Label7.Text = "to N/A" TextBox2.Text = CStr(Now.Date) End Sub Private Sub ComboBox1_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ComboBox1.SelectedIndexChanged ListBox1.Items.Clear() acc1 = New Account Select Case ComboBox1.SelectedItem Case Is = "Savings" GroupBox2.Enabled = True GroupBox3.Enabled = True GroupBox4.Enabled = True GroupBox5.Enabled = False Button1.Enabled = True Case Is = "Checking" GroupBox2.Enabled = True GroupBox3.Enabled = True GroupBox4.Enabled = True GroupBox5.Enabled = True Button1.Enabled = True End Select 'finds, displays new balances and shows transactions in listbox. reDisplay(ListBox1, ComboBox1.SelectedItem) End Sub 'Finds and Display the current balances in both accounts Private Sub currBal(ByVal type1 As String) Dim flagA As Boolean = False, flagB As Boolean = False 'gets and sets the current balance for the savings and checking accounts For i As Integer = ac.GetUpperBound(0) To 0 Step -1 If ac(i) IsNot Nothing Then If ac(i).Type = "Savings" And flagA = False Then sBal = ac(i).SaveBalance : flagA = True End If If ac(i).Type = "Checking" And flagB = False Then cBal = ac(i).CheckBalance : flagB = True End If If flagA = True And flagB = True Then Exit For End If End If Next TextBox1.TextAlign = HorizontalAlignment.Center If type1 = "Savings" Then TextBox1.Text = FormatCurrency(sBal, 2) Else TextBox1.Text = FormatCurrency(cBal, 2) End If End Sub 'Handles the File storing of all transactions Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click fileControl("Save") End Sub 'Handles the Deposit Groupbox Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click flag = False acc1 = New Account acc1.DateNow = curDateTime.Substring(0, curDateTime.IndexOf(" ")) acc1.Name = "Deposit" acc1.Ammount = CDbl(TextBox3.Text) acc1.Type = ComboBox1.SelectedItem If ComboBox1.SelectedItem = "Savings" Then acc1.calcSav("Deposit", acc1.Ammount, sBal) If flag = False Then ReDim Preserve ac(ac.GetUpperBound(0) + 1) ac(count) = acc1 count += 1 End If Else acc1.calcCheck("Deposit", acc1.Ammount, cBal) If flag = False Then ReDim Preserve ac(ac.GetUpperBound(0) + 1) ac(count) = acc1 count += 1 End If End If reDisplay(ListBox1, ComboBox1.SelectedItem) End Sub 'Handles the Withdrawal Groupbox Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click flag = False acc1 = New Account acc1.DateNow = curDateTime.Substring(0, curDateTime.IndexOf(" ")) acc1.Name = "Withdrawal" acc1.Ammount = CDbl(TextBox4.Text) acc1.Type = ComboBox1.SelectedItem If ComboBox1.SelectedItem = "Savings" Then acc1.calcSav("Withdrawal", acc1.Ammount, sBal) If flag = False Then ReDim Preserve ac(ac.GetUpperBound(0) + 1) ac(count) = acc1 count += 1 End If Else acc1.calcCheck("Withdrawal", acc1.Ammount, cBal) If flag = False Then ReDim Preserve ac(ac.GetUpperBound(0) + 1) ac(count) = acc1 count += 1 End If End If reDisplay(ListBox1, ComboBox1.SelectedItem) End Sub 'Handles the Transfer Groupbox Private Sub Button4_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button4.Click flag = False acc1 = New Account acc1.Ammount = CDbl(TextBox5.Text) acc1.Type = ComboBox1.SelectedItem acc1.DateNow = curDateTime.Substring(0, curDateTime.IndexOf(" ")) currBal(ComboBox1.SelectedItem) 'the following code is used if using the savings account If ComboBox1.SelectedItem = "Savings" Then acc1.calcTrans(ComboBox2.SelectedItem, acc1.Ammount, cBal, sBal) If ComboBox2.SelectedItem = "Savings" Then acc1.Name = "Transfer to Checking" ElseIf ComboBox2.SelectedItem = "Checking" Then acc1.Name = "Transfer from Checking" End If If flag = False Then ReDim Preserve ac(ac.GetUpperBound(0) + 1) Dim bal = acc1.CheckBalance ac(count) = acc1 count += 1 ReDim Preserve ac(ac.GetUpperBound(0) + 1) acc1 = New Account acc1.CheckBalance = bal acc1.DateNow = curDateTime.Substring(0, curDateTime.IndexOf(" ")) acc1.Ammount = CDbl(TextBox5.Text) acc1.Type = "Checking" If ComboBox2.SelectedItem = "Savings" Then acc1.Name = "Transfer from Savings" Else acc1.Name = "Transfer to Savings" End If ac(count) = acc1 count += 1 End If Else 'the following code is used if using the checking account acc1.calcTrans(ComboBox2.SelectedItem, acc1.Ammount, cBal, sBal) If ComboBox2.SelectedItem = "Savings" Then acc1.Name = "Transfer from Savings" ElseIf ComboBox2.SelectedItem = "Checking" Then acc1.Name = "Transfer to Savings" End If If flag = False Then ReDim Preserve ac(ac.GetUpperBound(0) + 1) Dim bal = acc1.SaveBalance ac(count) = acc1 count += 1 ReDim Preserve ac(ac.GetUpperBound(0) + 1) acc1 = New Account acc1.SaveBalance = bal acc1.DateNow = curDateTime.Substring(0, curDateTime.IndexOf(" ")) acc1.Ammount = CDbl(TextBox5.Text) acc1.Type = "Savings" If ComboBox2.SelectedItem = "Savings" Then acc1.Name = "Transfer to Checking" Else acc1.Name = "Transfer from Checking" End If ac(count) = acc1 count += 1 End If End If reDisplay(ListBox1, ComboBox1.SelectedItem) End Sub 'Handles the Checking Check Groupbox Private Sub Button5_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button5.Click flag = False acc1 = New Account acc1.DateNow = curDateTime.Substring(0, curDateTime.IndexOf(" ")) acc1.Ammount = CDbl(TextBox6.Text) acc1.Name = "Check cashed by " & CStr(TextBox7.Text) acc1.Type = "Checking" acc1.calcCheck("Check", acc1.Ammount, cBal) If flag = False Then ReDim Preserve ac(ac.GetUpperBound(0) + 1) ac(count) = acc1 count += 1 End If reDisplay(ListBox1, ComboBox1.SelectedItem) End Sub 'triggered when user inputs name into check Private Sub TextBox7_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TextBox7.Click MessageBox.Show("Please only input Company Name") End Sub 'triggered when not funds are available Private Sub Funds_Check() Handles acc1.FundsError MessageBox.Show("Funds Not Available for transaction") flag = True End Sub 'finds, displays new balances and shows transactions in listbox. Private Sub reDisplay(ByVal lB As ListBox, ByVal type As String) currBal(type) acc1.Trans = ac acc1.popList(ListBox1, type) flag = False End Sub Class Transaction Private t_name As String Private t_ammount As Double Private t_date As String Private t_type As String Public Property Name() Get Return t_name End Get Set(ByVal value) t_name = value End Set End Property Public Property Ammount() Get Return t_ammount End Get Set(ByVal value) t_ammount = value End Set End Property Public Property DateNow() Get Return t_date End Get Set(ByVal value) t_date = value End Set End Property Public Property Type() Get Return t_type End Get Set(ByVal value) t_type = value End Set End Property End Class Class Account Inherits Transaction Private a_Trans() As Account Private a_Trans1() As Account Private a_Count As Double = 0 Private a_savBalance As Double Private a_checkBalance As Double Public Event FundsError() Public Event TransSuccess(ByVal type As String) Public Property Trans() Get Return a_Trans(a_Count) End Get Set(ByVal value) a_Trans = value End Set End Property Public Property Trans1() Get Return a_Trans1(a_Count) End Get Set(ByVal value) a_Trans1 = value End Set End Property Public Property Count() Get Return a_Count End Get Set(ByVal value) a_Count = value End Set End Property Public Property SaveBalance() Get Return a_savBalance End Get Set(ByVal value) a_savBalance = value End Set End Property Public Property CheckBalance() Get Return a_checkBalance End Get Set(ByVal value) a_checkBalance = value End Set End Property 'Handles Saving Account calculations - Deposit/Withdrawal Sub calcSav(ByVal Type1 As String, ByVal ammount As Double, ByVal bal As Double) Select Case Type1 Case Is = "Deposit" a_savBalance = bal + ammount RaiseEvent TransSuccess("Deposit") Case Is = "Withdrawal" If bal
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote