Skip to content

Instantly share code, notes, and snippets.

@wedburst
Created October 23, 2020 18:12
Show Gist options
  • Select an option

  • Save wedburst/41cc7360beff68c89f7bea7a4bcd3bde to your computer and use it in GitHub Desktop.

Select an option

Save wedburst/41cc7360beff68c89f7bea7a4bcd3bde to your computer and use it in GitHub Desktop.
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