Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function jurosComp(capital, taxa, tempo){
- for(let i = 0; i < tempo; i++){
- capital = capital * (taxa/100) + capital;
- }
- return console.log('Juros compostos: R$', capital.toFixed(2).replace('.', ','));
- }
- function jurosSimp(capital, taxa, tempo){
- let rendimento = capital * (taxa/100);
- for(let i = 0; i < tempo; i++){
- capital = capital + rendimento;
- }
- return console.log('Juros simples: R$', capital.toFixed(2).replace('.', ','));
- }
- jurosComp(1423.65, 3.76, 13);
- jurosSimp(1423.65, 3.76, 13);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement