Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Develop a Monthly Balance calculator In this exercise, youll develop an application that allows you to enter deposits and withdrawals for a bank account. The
Develop a Monthly Balance calculator
In this exercise, youll develop an application that allows you to enter deposits and withdrawals for a bank account. The application displays all the transactions, along with a running balance. The interface looks like this:
- Download the balance.zip file and unzip it to give you your balance exercise folder. Notice that there are two JavaScript files, one with a prefix of "library_".
- In the balance.js file, note that four functions are supplied. The $ function. The updateDisplay and add functions that contain the code for the application. And an onload event handler that attaches the add function to the click event of the Add Transaction button and calls the updateDisplay function.
- In the library_balance.js file, note that an empty array and the start of three functions are supplied.
- Review the updateDisplay function in the balance.js file. Note that it calls the getTransaction function of the library file twice. In the first call, no argument is passed and the total number of transactions is returned. In the second call, the value of the loops index is passed and a specific transaction is returned. Now, code the getTransaction function in the library file.
- Note that the updateDisplay function also calls the calculateBalance function of the library file. This code passes the values it receives from the getTransaction function, and the current balance is returned. Now, code the calculateBalance function in the library file.
- Review the add function in the balance.js file. Note that it calls the addTransaction function of the library file, passes it values entered by the user, and doesnt receive any value in return. Also note that this function can accept variable numbers of arguments, depending on whether the user entered a value for the date. Now, code the addTransaction function in the library file. Assume that it will use todays date if it isnt passed a date.
- Create a .zip file from the folder containing your solution.
- Upload your .zip file.
PreviousNext
Monthly Balance Calculator Add Transaction Date: 12/15/2015 Type Deposit Amount150 Add Transaction Transactions Date Amount Balance Dec 01 2015 Dec 05 2015 Dec 12 2015 Dec 15 2015 1000 (100) (200) 150 1000 900 700 850 Monthly Balance Calculator Add Transaction Date: 12/15/2015 Type Deposit Amount150 Add Transaction Transactions Date Amount Balance Dec 01 2015 Dec 05 2015 Dec 12 2015 Dec 15 2015 1000 (100) (200) 150 1000 900 700 850Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started