jueves, 9 de marzo de 2017

-1 EJERCICIO 

<html>
<head>
</head>
<body>
<script type="text/javascript">
  var nombre;
  nombre=prompt('Ingrese su nombre:','');
  document.write(nombre);
  document.write('<br>');
     function mostrarSeleccionado()
  {
    if (document.getElementById('radio1').checked)
    {
      var num1;
  var num2;
  num1=prompt('ingresa el primer numero:','');
  num2=prompt('ingresa el segundo numero:','');
  var suma=parseInt(num1)+parseInt(num2);
 
      alert('la suma es: ' +suma);
    }
    if (document.getElementById('radio2').checked)
    {
      var num1;
  var num2;
  num1=prompt('ingresa el primer numero:','');
  num2=prompt('ingresa el segundo numero:','');
  var resta=parseInt(num1)-parseInt(num2);
      alert('la resta es: ' +resta);
    }
  }
</script>

<form>
<input type="radio" id="radio1" name="estudios">suma
<br>
<input type="radio" id="radio2" name="estudios">resta
<br>
<input type="button" value="Mostrar" onClick="mostrarSeleccionado()">
</script>
</body>
<html>
<head>
</head>
<body>
<script type="text/javascript">
  var nombre;
  nombre=prompt('Ingrese su nombre:','');
  document.write(nombre);
  document.write('<br>');
     function mostrarSeleccionado()
  {
    if (document.getElementById('radio1').checked)
    {
      var num1;
  var num2;
  num1=prompt('ingresa el primer numero:','');
  num2=prompt('ingresa el segundo numero:','');
  var suma=parseInt(num1)+parseInt(num2);
 
      alert('la suma es: ' +suma);
    }
    if (document.getElementById('radio2').checked)
    {
      var num1;
  var num2;
  num1=prompt('ingresa el primer numero:','');
  num2=prompt('ingresa el segundo numero:','');
  var resta=parseInt(num1)-parseInt(num2);
      alert('la resta es: ' +resta);
    }
  }
</script>

<form>
<input type="radio" id="radio1" name="estudios">suma
<br>
<input type="radio" id="radio2" name="estudios">resta
<br>
<input type="button" value="Mostrar" onClick="mostrarSeleccionado()">
</script>
</body>
</html>




-2 EJERCICIO


<html>
<head>
</head>
<body>
<script type="text/javascript">
  var nota1,nota2,nota3,nota4,nota5;
  var nombre,materia1,materia2,materia3,materia4,materia5;
  nombre=prompt('ingrese nombre:','');
  materia1=prompt('ingrese 1ra. materia:','');
  nota1=prompt('Ingrese 1ra. nota:','');
  materia2=prompt('ingrese 2da. materia:','');
  nota2=prompt('Ingrese 2da. nota:','');
  materia3=prompt('ingrese 3ra. materia:','');
  nota3=prompt('Ingrese 3ra. nota:','');
  materia4=prompt('ingrese 4ta. materia:','');
  nota4=prompt('Ingrese 4ta. nota:','');
  materia5=prompt('ingrese 5ta. materia:','');
  nota5=prompt('ingrese 5ta. nota:','');
 
  nota1=parseInt(nota1);
  nota2=parseInt(nota2);
  nota3=parseInt(nota3);
  nota4=parseInt(nota4);
  nota5=parseInt(nota5);
  var pro;
  pro=(nota1+nota2+nota3+nota4+nota5)/5;
  if (pro>=7)
  {
    document.write(' hola ' +nombre+ ' aprobaste estas son tu siguientes calificaciones: ');
    document.write(' materia ' +materia1+ ' calificacion ' +nota1);
    document.write('<br>');
    document.write(' materia ' +materia2+ ' calificacion ' +nota2);
    document.write('<br>');
    document.write(' materia ' +materia3+ ' calificacion ' +nota3);
    document.write('<br>');
    document.write(' materia ' +materia4+ ' calificacion ' +nota4);
    document.write('<br>');
    document.write(' materia ' +materia5+ ' calificacion ' +nota5);
    document.write('<br>');
 
  }

</script>
</body>
</html>




-3 EJERCICIO


<HTML>
<head>
</head>
<body>

<script type="text/javascript">
function mostrar()
{

  var mat1=document.getElementById('Materia 1').value;
  var cal1=document.getElementById('Calificacion 1').value;
  alert('Materia 1:' + mat1);
  alert('Calificacion 1:' + cal1);

  var mat2=document.getElementById('Materia 2').value;
  var cal2=document.getElementById('Calificacion 2').value;
  alert('Materia 2:' + mat2);
  alert('Calificacion 2:' + cal2);

  var mat3=document.getElementById('Materia 3').value;
  var cal3=document.getElementById('Calificacion 3').value;
  alert('Materia 3:' + mat3);
  alert('Calificacion 3:' + cal3);

  var mat4=document.getElementById('Materia 4').value;
  var cal4=document.getElementById('Calificacion 4').value;
  alert('Materia 4:' + mat4);
  alert('Calificacion 4:' + cal4);

  var mat5=document.getElementById('Materia 5').value;
  var cal5=document.getElementById('Calificacion 5').value;
  alert('Materia 5:' + mat5);
  alert('Calificacion 5:' + cal5);

  var suma=(parseInt(cal1)+parseInt(cal2)+parseInt(cal3)+parseInt(cal4)+parseInt(cal5));
  var prom=suma/5;
  document.write('Tu promedio es:','');
  document.write(prom);

  document.write('<br>');

  if(prom>=6){
    document.write('Aprobado','');
  }else
    document.write('Reprobado','');
}
</script>

<form>

Ingrese la primera materia:
<input type="text" id="Materia 1"><br>
Ingrese la calificacion 1:
<input type="text" id="Calificacion 1"><br>
<br>
<br>

Ingrese la segunda materia:
<input type="text" id="Materia 2"><br>
Ingrese la calificacion 2:
<input type="text" id="Calificacion 2"><br>
<br>
<br>

Ingrese la tercera materia:
<input type="text" id="Materia 3"><br>
Ingrese la calificacion 3:
<input type="text" id="Calificacion 3"><br>
<br>
<br>

Ingrese la cuarta materia:
<input type="text" id="Materia 4"><br>
Ingrese la calificacion 4:
<input type="text" id="Calificacion 4"><br>
<br>
<br>

Ingrese la quinta materia:
<input type="text" id="Materia 5"><br>
Ingrese la calificacion 5:
<input type="text" id="Calificacion 5"><br>
<input type="button" value="Confirmar" onClick="mostrar()">
<br>
<br>

</form>

</body>
</html>





No hay comentarios:

Publicar un comentario