Warning: mkdir(): No space left on device in /var/www/hottg/post.php on line 59

Warning: file_put_contents(aCache/aDaily/2025-07-15/post/frontendInterview/--): Failed to open stream: No such file or directory in /var/www/hottg/post.php on line 72
​Рост численности населения @Frontend Interview - собеседования по Javascript / Html / Css
TG Telegram Group & Channel
Frontend Interview - собеседования по Javascript / Html / Css | United States America (US)
Create: Update:

Рост численности населения

В небольшом городе население в начале года составляет p0 = 1000 человек. Население регулярно увеличивается на 2 процента в год, и кроме того, в город приезжает 50 новых жителей в год. Сколько лет нужно городу, чтобы его население стало больше или равно p = 1200 жителей?

At the end of the first year there will be: 
1000 + 1000 * 0.02 + 50 => 1070 inhabitants

At the end of the 2nd year there will be:
1070 + 1070 * 0.02 + 50 => 1141 inhabitants (** number of inhabitants is an integer **)

At the end of the 3rd year there will be:
1141 + 1141 * 0.02 + 50 => 1213

It will need 3 entire years.


Более общие заданные параметры:
p0, percent, aug (inhabitants coming or leaving each year), p (population to equal or surpass)


Функция nb_year должна возвращать n количество полных лет, необходимых для получения численности населения, большей или равной p.

aug - целое число, percent - положительное или нулевое плавающее число, p0 и p - положительные целые числа (> 0)

Примеры:
nb_year(1500, 5, 100, 5000) -> 15
nb_year(1500000, 2.5, 10000, 2000000) -> 10


👉 @frontendInterview

Рост численности населения

В небольшом городе население в начале года составляет p0 = 1000 человек. Население регулярно увеличивается на 2 процента в год, и кроме того, в город приезжает 50 новых жителей в год. Сколько лет нужно городу, чтобы его население стало больше или равно p = 1200 жителей?

At the end of the first year there will be: 
1000 + 1000 * 0.02 + 50 => 1070 inhabitants

At the end of the 2nd year there will be:
1070 + 1070 * 0.02 + 50 => 1141 inhabitants (** number of inhabitants is an integer **)

At the end of the 3rd year there will be:
1141 + 1141 * 0.02 + 50 => 1213

It will need 3 entire years.


Более общие заданные параметры:
p0, percent, aug (inhabitants coming or leaving each year), p (population to equal or surpass)


Функция nb_year должна возвращать n количество полных лет, необходимых для получения численности населения, большей или равной p.

aug - целое число, percent - положительное или нулевое плавающее число, p0 и p - положительные целые числа (> 0)

Примеры:
nb_year(1500, 5, 100, 5000) -> 15
nb_year(1500000, 2.5, 10000, 2000000) -> 10


👉 @frontendInterview
1


>>Click here to continue<<

Frontend Interview - собеседования по Javascript / Html / Css






Share with your best friend
VIEW MORE

United States America Popular Telegram Group (US)


Warning: Undefined array key 3 in /var/www/hottg/function.php on line 115

Fatal error: Uncaught mysqli_sql_exception: Can't create/write to file '/tmp/#sql-temptable-a06e-3af732-278.MAI' (Errcode: 28 "No space left on device") in /var/www/hottg/function.php:216 Stack trace: #0 /var/www/hottg/function.php(216): mysqli_query() #1 /var/www/hottg/function.php(115): select() #2 /var/www/hottg/post.php(351): daCache() #3 /var/www/hottg/route.php(63): include_once('...') #4 {main} thrown in /var/www/hottg/function.php on line 216