Dexter18 Posted April 2, 2014 Share Posted April 2, 2014 Arkadaşlar bir ödevim var soru şu Türkiye nüfusu 10 milyon olup yılda %5 artmaktadır. Almanya nüfusu ise 15 milyon olup %2 azalmaktadır. Buna göre Türkiye nufusu almanyayı kaç yılda geçer? Cevabı javascript şeklinde olacak.. Quote Link to comment Share on other sites More sharing options...
KintaRo Posted April 2, 2014 Share Posted April 2, 2014 mantık olarak hesaplanması şu şekildedir: turkiye_nufus = 10000000; almanya_nufus = 15000000; yil = 0; while turkiye_nufus < almanya_nufus do yil = yil+1; turkiye_nufus = turkiye_nufus+(turkiye_nufus*0.05); almanya_nufus = almanya_nufus-(almanya_nufus*0.02); end Dialog.Message("Geçen Yıl", yil) java'ya uyarlayıp yapması da sana kalmış. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.