<html> <head> <title>Programa Java</title> </head> <script language="javascript"> var a=0; function datos() { s= forma1.sueldo.value*1; if (s <= 100) { a=s*0.1; p="10%"; } else { if (s <= 500) { a=s*0.2; p="20%"; } else { a=s*0.3; p="30%"; } } nuevo=s+a; document.write ("Nombre-----> "+ forma1.nombre.value + "<br>"); document.write ("Sueldo------> " + s + "<br>"); document.write ("Porcentaje--> "+ p + "<br>"); document.write ("Aumento----> "+ a + "<br>"); document.write ("Nuevo-------> " + nuevo + "<br>"); } </script> <body> <img src="../imagenes/logo.jpg" width="51" height="46" border="0" align ="rigth" >Ejercicio Utilizando IF anidados<br> <div align="center"> <h3> <marquee scrollamount="6" width="500" alternate="behabior">Calculo nuevo Sueldo de acuerdo a tabla de porcentajes </marquee></h3></div> <p> sueldo < 100 incrementar 10%, entre 100 y 500 el 20%, mayor a 500 el 30% </p><br> <hr size="3" color="red" width="1200"> <form name="forma1" id="forma1" method="post"> Nombre:<input type="text" name="nombre" maxlength="45"><br> Sueldo :<input type="text" name="sueldo" maxlength="7"><br> </form> <a href="javascript:datos();">Calcular</a><br> <a href="sueldo.pdf">Codigo</a> </body>