Created
October 23, 2020 18:12
-
-
Save wedburst/41cc7360beff68c89f7bea7a4bcd3bde to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function lifeInWeeks(age) { | |
| /************Don't change the code above************/ | |
| var age = prompt ("cual es tu edad?"); | |
| var year = prompt ("año a calcular?"); | |
| var weeks = 52; | |
| var days = 365; | |
| var month = 12; | |
| // var year = 90; | |
| //var diasvividos = age * days; | |
| var anorestante = year - age; | |
| var diasrestantes = days * anorestante; | |
| var weeksless = weeks * anorestante; | |
| var weekfix = weeksless.toFixed(); | |
| // var monthless = weeksless / month; | |
| var monthless = month * anorestante; | |
| var monthfix = monthless.toFixed(); | |
| console.log("Te quedan " + diasrestantes + " días, y " + weekfix + " semanas con " + monthfix + " meses para cumplir " + year + " años."); | |
| /*************Don't change the code below**********/ | |
| } | |
| lifeInWeeks(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment