Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 93049b3

Browse files
problem 64 solved
1 parent deeb23e commit 93049b3

File tree

1 file changed

+24
-0
lines changed

1 file changed

+24
-0
lines changed

‎problem64/problem64.js

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -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

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /