Created
October 27, 2011 04:52
-
-
Save JuliaGabellone/1318803 to your computer and use it in GitHub Desktop.
This file contains 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 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) | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Pegale una miradita al ultimo if....tiene un errocito.