CODIGO PARA PROMEDIO
<html>
<body bgcolor="green">
<title> Estructuras condicionales </title>
Uso de las estructuras condicionales IF <br>
ingreso de Notas y solucionar Notas promediales <br><br>
Nombre del Alumno Nota1 Nota 2 Nota 3 Promedio <br>
<input type="button" value ="promedio" onclick ="prom();"> <br>
<input type="text" id="tnom" size="20">
<input type="text" id="t1"value="0" size="4">
<input type="text" id="t2" value="0" size="4">
<input type="text" id="t3" value="0" size="4">
<input type="text" id="tprom" value="0" size="4">
<input type="text" id="tobs" value="0"size="15">
<br>
<script>
function prom(){
var n1=document.getElementById('t1').value;
var n2=document.getElementById('t2').value;
var n3=document.getElementById('t3').value;
var pro=(parseInt(n1)+parseInt(n2)+parseInt(n3))/3;
document.getElementById('tprom').value=pro
if (pro<10.4){
document.getElementById('tobs').value="desaprobado"
} else{
document.getElementById('tobs').value="aprobado"
}
}
</script>
CODIGO PARA TU PROGRAMA HTML <br><fieldset>
<textarea>
<html>
<title> Estructuras condicionales </title>
Uso de las estructuras condicionales IF <br>
ingreso de Notas y solucionar Notas promediales <br><br>
Nombre del Alumno Nota1 Nota 2 Nota 3 Promedio <br>
<input type="text" id="t1" size="16">
<input type="text" id="t2" size="4">
<input type="text" id="t1" size="4">
<input type="text" id="t1" size="4">
<input type="text" id="t1" size="4">
<br>
<input type="button" id="b1" value="Promedio">
</html>
</textarea></fieldset>
</body></html>
| <html> | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| <body style="background-color:rgb(255,0,0);"> | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| </body> | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| <font size="10" color="black">BODEGA "ELITA"</font> | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| <hr> | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| <body background="bg.jpg"> | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| <form name="examen" method=""> | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| <h2>Cantidad Descripcion | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Precio | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| <input type="button" value="total" onclick="TOT();"> | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| </h2> | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| <p> | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| <input type="text" id="t1" value="6" size="08">   | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| <input type="text" id="t2" value="4" size="15"> | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| <input type="text" id="t3" value="2" size="7"> | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| <input type="text" id="t4" value="0" size="7"> | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| <p> | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| <input type="text" id="t5" value="4" size="08"> | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| <input type="text" id="t6" value="8" size="15"> | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| <input type="text" id="t7" value="6" size="7"> | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| <input type="text" id="t8" value="0" size="7"> | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| <hr> | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| <font size="6">Subtotal</font> <input type="text" id="tp" size="8"> | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| <p> | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| <font size="6">Descuento del 10%</font> | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| <br> | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| <input type="radio" name="radio1" id="radio1" />Si<br> | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| <input type="text" id="y9" size="5"><p> | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| <input type="radio" name="radio1" id="radio1" />No<br> | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| <hr> | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| <input type="button" name="result" id="result" value="RESPUESTA" onclick="cont()"/> | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| <input type="text" id="y9" size="5"> | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| </form> | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| <script> | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| function TOT() { | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| var n1=document.getElementById('t1').value; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| var n2=document.getElementById('t2').value; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| var n3=document.getElementById('t3').value; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| var total= parseInt(n1) + parseInt(n2) + parseInt(n3) ; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| document.getElementById('t4').value=total | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| var n1a=document.getElementById('t5').value; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| var n2a=document.getElementById('t6').value; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| var n3a=document.getElementById('t7').value; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| var totala= parseInt(n1a) + parseInt(n2a) + parseInt(n3a) ; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| document.getElementById('t8').value=total | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| var tit= parseInt(total)/2 + parseInt(totala)/2; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| document.getElementById('tp').value=tit | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| } | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| </script> | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| </html> OPERACIONES
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| <html> | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| <fieldset style="width:20%"> | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Tabla de multiplicar <br> | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| </fieldset> | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| <fieldset style="width:20%"> | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| <script> | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| var i=0; for (i=0;i<=12;i++) | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| { | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| document.write("N. " + i +" x 2 =" ); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| document.write("<font color=blue>" + (i*2) + "</font>"); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| document.write("<br />"); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| } | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| document.write("<hr>"); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| for (i=0;i<=12;i++) | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| { | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| document.write("N. " + i+" x 3 =" + (i*3 ) ); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| document.write("<br />"); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| } | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| document.write("<hr>"); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| for (i=0;i<=5;i++) | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| { | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| document.write("N. " + i+" x 4 =" + (i*4 ) ); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| document.write("<br />"); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| } | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| document.write("<hr>"); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| for (i=0;i<=5;i++) | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| { | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| document.write("N. " + i+" x 5 =" + (i*5 ) ); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| document.write("<br />"); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| } | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| </script> | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| </html> |
</html>
imagen
| <html> | |||||||||||||||||||||||||||||||||||||||||||||||||
| <body background="01.jpg"> | |||||||||||||||||||||||||||||||||||||||||||||||||
| </body> | |||||||||||||||||||||||||||||||||||||||||||||||||
| <br> | |||||||||||||||||||||||||||||||||||||||||||||||||
| <center><H1><marquee behaviador="alterne" hspace="400" scrollamount="10"> | |||||||||||||||||||||||||||||||||||||||||||||||||
| <font face="Cooper" color="black"> | |||||||||||||||||||||||||||||||||||||||||||||||||
| Ayacucho - Peru | |||||||||||||||||||||||||||||||||||||||||||||||||
| </font> | |||||||||||||||||||||||||||||||||||||||||||||||||
| </marquee><H1></center> | |||||||||||||||||||||||||||||||||||||||||||||||||
| <body bgcolor="#ACD1D0"> | |||||||||||||||||||||||||||||||||||||||||||||||||
| </body> | |||||||||||||||||||||||||||||||||||||||||||||||||
| <h1> Ciudad de Ayacucho </h1> | |||||||||||||||||||||||||||||||||||||||||||||||||
| La fe del pueblo ayacuchano se refleja en los templos construidos a lo largo de la ciudad. Además, disfruta la arquitectura colonial presente en cada rincón. | |||||||||||||||||||||||||||||||||||||||||||||||||
| <br><br> | |||||||||||||||||||||||||||||||||||||||||||||||||
| <button type="button" onclick="verfoto1()">platos tipicos</button> | |||||||||||||||||||||||||||||||||||||||||||||||||
| <button type="button" onclick="verfoto2()">carnavales</button> | |||||||||||||||||||||||||||||||||||||||||||||||||
| <button type="button" onclick="verfoto3()">semana santa</button> | |||||||||||||||||||||||||||||||||||||||||||||||||
| <div id="myDiv" style="border:1px solid black; height:400; | |||||||||||||||||||||||||||||||||||||||||||||||||
| width:400;"> | |||||||||||||||||||||||||||||||||||||||||||||||||
| Imagen capturada</div> | |||||||||||||||||||||||||||||||||||||||||||||||||
| <script> | |||||||||||||||||||||||||||||||||||||||||||||||||
| function verfoto1() | |||||||||||||||||||||||||||||||||||||||||||||||||
| { document.getElementById("myDiv").style.backgroundImage="url('platos.png')";} | |||||||||||||||||||||||||||||||||||||||||||||||||
| function verfoto2() | |||||||||||||||||||||||||||||||||||||||||||||||||
| { document.getElementById("myDiv").style.backgroundImage="url('rural.jfif')";} | |||||||||||||||||||||||||||||||||||||||||||||||||
| function verfoto3() | |||||||||||||||||||||||||||||||||||||||||||||||||
| { document.getElementById("myDiv").style.backgroundImage="url('santa.jpg')";} | |||||||||||||||||||||||||||||||||||||||||||||||||
| </script> | |||||||||||||||||||||||||||||||||||||||||||||||||
| </body> | |||||||||||||||||||||||||||||||||||||||||||||||||
| </html> index
|
No hay comentarios.:
Publicar un comentario