Tercer Periodo

Multiplicación de números

import java.util.Scanner;

public class MultiplicarNumeros2

{

public static void main (String[] args)

{

int n1, n2, producto;

Scanner teclado = new Scanner (System.in);

System.out.print("Primer Numero: ");

n1 = teclado.nextInt();

System.out.print("Segundo Numero: ");

n2 = teclado.nextInt();

producto = n1 * n2;

System.out.printf("La multiplicación es:%d",producto);

}

}

 

Suma Productos

import java.util.Scanner;

public class SumaProductos

{

public static void main(String[] args)

{

int n1,n2,n3,n4,p1,p2,t1;

Scanner teclado = new Scanner(System.in);

 System.out.print("Introduzca el primer número:");

n1 = teclado.nextInt();

 System.out.print("Introduzca el segundo número:");

n2 = teclado.nextInt();

 System.out.print("Introduzca el tercer número:");

n3 = teclado.nextInt();

 System.out.print("Introduzca el cuarto número:");

n4 = teclado.nextInt();

 p1 = n1*n2;

 p2 = n3*n4;

 t1= p1+p2;

 

System.out.printf("La multiplicación del primer número y el segundo es:%d",p1);

 System.out.printf("La multiplicación del tercer número y el cuarto es:%d",p2);

 System.out.printf("La suma de los productos es:%d",t1);

}

}

 

Promedio Notas

import java.util.Scanner;
public class PromedioNotas
{
 public static void main(String[] args)
 {
  int n1,n2,n3,n4,n5,n6,n7,n8,n9,n10,t,promedio,nota;
  Scanner teclado = new Scanner(System.in);
  
   System.out.print("Introduzca la primera nota:");
   n1 = teclado.nextInt();
  
   System.out.print("Introduzca la segunda nota:");
   n2 = teclado.nextInt();
 
   System.out.print("Introduzca la tercera nota:");
   n3 = teclado.nextInt();
 
   System.out.print("Introduzca la cuarta nota:");
   n4 = teclado.nextInt();
   
   System.out.print("Introduzca la quinta nota:");
   n5 = teclado.nextInt();
   
   System.out.print("Introduzca la sexta nota:");
   n6 = teclado.nextInt();
 
   System.out.print("Introduzca la séptima nota:");
   n7 = teclado.nextInt();
 
   System.out.print("Introduzca la octava nota:");
   n8 = teclado.nextInt();
 
   System.out.print("Introduzca la novena nota:");
   n9 = teclado.nextInt();
   
   System.out.print("Introduzca la décima nota:");
   n10 = teclado.nextInt();
   
   t = n1+n2+n3+n4+n5+n6+n7+n8+n9+n10;
   
   promedio = t/10;
   
   System.out.printf("La suma de todos las notas es :%d",t);
   
   System.out.printf("El promedio es :%d",promedio);
 
 
 
     if (n1>n2) {nota==n1
 
}else 
 
if (nota<n3) {nota==n3
     
}else 
 
if (nota<n4) {nota==n4
 
}else 
 
if (nota<n5) {nota==n5
 
}else
 
     if (nota<n6) {nota==n6
 
}else 
 
     if (nota<n7) {nota==n7
 
}else 
 
if (nota<n8) {nota==n8
 
}else 
 
if (nota<n9) {nota==n9
 
}else
 
if (nota<n10) {nota==n10
}else
 
 
System.out.printf("La nota más alta es :%d",nota);
 
 }
}
 
   
 
 

 

COEVALUACIÓN