We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent deeb23e commit 93049b3Copy full SHA for 93049b3
problem64/problem64.js
@@ -0,0 +1,24 @@
1
+
2
+/* =====================================================
3
+ ------ An Ideal Example of Callback Function --------
4
+ ===================================================== */
5
6
+ const totalMoney = (depositOne, depositTwo, interest) => {
7
8
+ const totalDepositAmount = depositOne + depositTwo ;
9
+ const profit = interest(totalDepositAmount);
10
+ return totalDepositAmount + parseFloat(profit) ;
11
+ }
12
13
14
+ const totalInterest = totalDeposit => {
15
+ const interestRate = 7 / 100 ; // Suppose Interest Rate is 7 %
16
+ return (totalDeposit*interestRate).toFixed(2);
17
+ };
18
19
20
+ const grandTotal = totalMoney(900, 1100, totalInterest);
21
22
+ console.log(grandTotal);
23
24
0 commit comments