Jump to content

Ödev Hakkında


Dexter18
 Share

Recommended Posts

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..

Link to comment
Share on other sites

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ış.

Link to comment
Share on other sites

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...