HTML Academy
Summary of “Functions”. Part 2
Functions23/24
Back to the list of tasks
  • 1. Fasten your seat belts
  • 2. Long-distance flight
  • 3. Going the second circle
  • 4. Helper function
  • 5. Function, I’m calling you!
  • 6. I have a parameter for you
  • 7. Order of parameters
  • 8. Return from function
  • 9. Summary of “Functions”. Part 1
  • 10. Seventh program: “From salary to salary”
  • 11. Business trip
  • 12. Write, simplify
  • 13. Get rid of unnecessary
  • 14. Make me beautiful
  • 15. Just add percentage
  • 16. Call me quietly by name
  • 17. I see the target
  • 18. How many flights?
  • 19. Let’s clean up a little
  • 20. Who is faster?
  • 21. Saving up for a trip around the world
  • 22. Summary of “Functions”. Part 2
  • 23. Eighth program: “Money makes money”
  • 24. Ninth program: “The Eternal Question”
Ninth program: “The Eternal Question”
  • Sign up
  • Log in

Register to take up challenges

Registration will only take a minute and let you save your study progress. You can register with your email and password or login via social networks.

or
Log in and continue
  • script.js
JavaScript
var calculateDeposit = function () { }; /* Technical assignment Meow! I need to calculate how much money I will make on deposits with different terms and conditions. Design the program as calculateDeposit function with four parameters: 1. Initial amount of the deposit; 2. Interest per annum (number from 0 to 100); 3. Term of deposit in months; 4. With capitalization of interest or not (flag with a Boolean value). The function must return the total amount of the deposit rounded to dollars using Math.round(). Use any parameter names. If we have a simple deposit, the annual interest is divided by 12 and multiplied by the term of the deposit, and then the initial amount increases by the calculated interest. Calculating a deposit with capitalization is more difficult: every month the annual interest accrued per month is added to the deposit amount (do not forget to divide the interest by 12), and the interest for the next month is calculated from the increased amount of the deposit. */

What didn’t you like in this task?

Thanks! We’ll fix everything at once!

Console

The code has changed, click “Run” or turn autorun on.

Result

Cookies ∙ Privacy ∙ License Agreement ∙ About ∙ Contacts ∙ © HTML Academy OÜ, 2019−2025

VISAMastercard

Log in

or

Forgot your password?

Sign up

Sign up

or
Log in

Restore access

Have you forgotten your password or lost access to your profile? Enter your email connected to your profile and we will send you a link to restore access.

Forgot to connect your email to the profile? Email us and we’ll help.