Skip to content

Instantly share code, notes, and snippets.

@JuliaGabellone
Created October 27, 2011 04:52
Show Gist options
  • Save JuliaGabellone/1318803 to your computer and use it in GitHub Desktop.
Save JuliaGabellone/1318803 to your computer and use it in GitHub Desktop.
function valor ( modelo , año , valor){
if (modelo != "fiesta" && modelo != "falcon"){
console.log("La empresa no trabaja con ese modelo")
return false
}
if (typeof(modelo)!='string' || typeof(año)!='number' || typeof(valor)!='number'){
return false
}
if (año < 1970){
resultado = ( valor - (50*valor/100))
}
if (año > 1990){
resultado = (valor -(10*valor/100))
}
if (año >=1970 && año =< 1990){
resultado = ( valor - (25*valor/100))
}
console.log("el valor de su auto" + " " + modelo + " " + año + " " + "es de" + " " + resultado + "$")
return true
}
valor("falcon", 1978 , 2000)
@jairodemorais
Copy link

Pegale una miradita al ultimo if....tiene un errocito.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment