<?php
//$payment=5000;
function balance ( $payment , $percent , $commission , $paymentForNothing ) {
$creditTotal = 0 ;
$creditTotal -= $paymentForNothing ;
$k = 0 ;
for ( $i = 0 ; $creditTotal <= 40000 ; $i ++ ) {
$creditTotal += $payment - $payment * $percent - $commission ;
if ( 40000 )
$k ++;
}
return $creditTotal ;
}
$homoCredit = balance( 5000 , 0.04 , 500 , 0 ) ;
$softBank = balance( 5000 , 0.03 , 1000 , 0 ) ;
$strawberryBank = balance( 5000 , 0.02 , 0 , 7777 ) ;
echo "In Homocredit bank you need to spent $homoCredit money before payment ends\n " ;
echo "In SoftBank bank you need to spent $softBank money before payment ends\n " ;
echo "In StrawberryBank bank you need to spent $strawberryBank money before payment ends\n " ;
// your code goes here
PD9waHAKLy8kcGF5bWVudD01MDAwOwpmdW5jdGlvbiBiYWxhbmNlICgkcGF5bWVudCwkcGVyY2VudCwkY29tbWlzc2lvbiwkcGF5bWVudEZvck5vdGhpbmcpewoJJGNyZWRpdFRvdGFsID0gMDsKCSRjcmVkaXRUb3RhbC09JHBheW1lbnRGb3JOb3RoaW5nOwoJJGsgPSAwOwpmb3IoJGk9MDskY3JlZGl0VG90YWw8PTQwMDAwOyRpKyspewoJJGNyZWRpdFRvdGFsICs9ICRwYXltZW50LSRwYXltZW50KiRwZXJjZW50LSRjb21taXNzaW9uOwoJaWYgKDQwMDAwKQoJJGsrKzsKfQpyZXR1cm4gJGNyZWRpdFRvdGFsOwp9CiRob21vQ3JlZGl0ID0gIGJhbGFuY2UoNTAwMCwwLjA0LDUwMCwwKTsKJHNvZnRCYW5rID0gIGJhbGFuY2UoNTAwMCwwLjAzLDEwMDAsMCk7CiRzdHJhd2JlcnJ5QmFuayA9ICBiYWxhbmNlKDUwMDAsMC4wMiwwLDc3NzcpOwplY2hvIkluIEhvbW9jcmVkaXQgYmFuayB5b3UgbmVlZCB0byBzcGVudCAkaG9tb0NyZWRpdCBtb25leSBiZWZvcmUgcGF5bWVudCBlbmRzXG4iOwplY2hvIkluIFNvZnRCYW5rIGJhbmsgeW91IG5lZWQgdG8gc3BlbnQgJHNvZnRCYW5rIG1vbmV5IGJlZm9yZSBwYXltZW50IGVuZHNcbiI7CmVjaG8iSW4gU3RyYXdiZXJyeUJhbmsgYmFuayB5b3UgbmVlZCB0byBzcGVudCAkc3RyYXdiZXJyeUJhbmsgbW9uZXkgYmVmb3JlIHBheW1lbnQgZW5kc1xuIjsKLy8geW91ciBjb2RlIGdvZXMgaGVyZQ==