what code can be used to automatically change the year of birth every year? | Sololearn: Learn to code for FREE!
Novo curso! Todo programador deveria aprender IA generativa!
Experimente uma aula grƔtis
0

what code can be used to automatically change the year of birth every year?

ŠŗŠ°ŠŗŠøŠ¼ ŠŗŠ¾Š“Š¾Š¼ Š¼Š¾Š¶Š½Š¾ ŠŗŠ°Š¶Š“ыŠ¹ Š³Š¾Š“ ŠøŠ·Š¼ŠµŠ½Šøть Š°Š²Ń‚Š¾Š¼Š°Ń‚ŠøчŠµŃŠŗŠø Š³Š¾Š“ рŠ¾Š¶Š“ŠµŠ½Šøя?

26th Aug 2021, 12:26 PM
Safarov Nusratullo Khandulloevich
Safarov Nusratullo Khandulloevich - avatar
11 Respostas
+ 5
Zip code
26th Aug 2021, 12:52 PM
Simba
Simba - avatar
+ 4
Wouldn't the year of birth stay the same and only the age changes? You could set the value by querying the current date and compare it to the year of birth. Please tag the relevant programming language.
26th Aug 2021, 12:43 PM
Lisa
Lisa - avatar
+ 2
Every language can do it. We just have to run the code to update (though in a real world application we would probably keep all the students' data in a database)
26th Aug 2021, 1:31 PM
Lisa
Lisa - avatar
+ 2
The actual code depends on the programming language. By "running the code" I mean "executing the code"
26th Aug 2021, 2:14 PM
Lisa
Lisa - avatar
+ 2
You have to write it. Which programming language?
26th Aug 2021, 3:26 PM
Lisa
Lisa - avatar
+ 1
I will say now for example: a student is studying in the first year next year he must become the 2nd year .... the question is in what language can you do this so that the automatic system does it for the 2nd year?
26th Aug 2021, 1:28 PM
Safarov Nusratullo Khandulloevich
Safarov Nusratullo Khandulloevich - avatar
+ 1
* store the year when the student started * fetch the current date * compare the current year to the starting year * the current grade then is 1 + difference of current year and starting year
26th Aug 2021, 7:03 PM
Lisa
Lisa - avatar
+ 1
Thank you!
27th Aug 2021, 4:48 PM
Safarov Nusratullo Khandulloevich
Safarov Nusratullo Khandulloevich - avatar
0
What is code?
26th Aug 2021, 1:52 PM
Safarov Nusratullo Khandulloevich
Safarov Nusratullo Khandulloevich - avatar
0
where can I find the code?
26th Aug 2021, 3:25 PM
Safarov Nusratullo Khandulloevich
Safarov Nusratullo Khandulloevich - avatar
0
JS
26th Aug 2021, 3:27 PM
Safarov Nusratullo Khandulloevich
Safarov Nusratullo Khandulloevich - avatar