Untitled

mail@pastecode.io avatar
unknown
plain_text
2 years ago
565 B
0
Indexable
Never
function test(){
    let money = 1100;
		let months = 9;
    let withdraw = 0;
    let percentage = 0;
	
	for (let i = 0; i < months * 30; i++) {
		if(i/30 === 3){
  	      money += 500;
  	}

  	if(money > 10000){
    	percentage = 1.4;
    } else {
    	percentage = 0.8;
    }
    
    if(withdraw >= 100){
    	money += withdraw;
			withdraw = 0;
    }
    
    withdraw += (percentage/100)*money;
    console.log(withdraw);
	}
  money -= 1500;
  console.log(Math.round(money + withdraw),Math.round(money + withdraw)*1.72);
}
test();