Inactive Tutor answered 10/11/19
One way you can do it is to begin by creating the known values as either as constants or variables.
Once you have the first two values then it's a matter of multiplying the seconds in one year times the rate. Then you store the value. Since there are no actual variables you don't need to create a function. You would need a function or method in Java or C# but not in something like Python or JavaScript.
Above is the example in JavaScript. Now you would just print it to the screen.
Inactive Tutor
The weird looking regex strings are just to format the number with commas. JavaScript does not have an easy way to add commas.10/11/19