Skip to content

Instantly share code, notes, and snippets.

@DanyEscobar
Last active April 3, 2016 16:05
Show Gist options
  • Select an option

  • Save DanyEscobar/6430fcbd322844b1aeb74da3b254316b to your computer and use it in GitHub Desktop.

Select an option

Save DanyEscobar/6430fcbd322844b1aeb74da3b254316b to your computer and use it in GitHub Desktop.
import java.util.Scanner;
public class Arreglos {
public static void main(String[] args) {
double[] notas = new double [7];
Scanner leer=new Scanner(System.in);
int i;
double prom=0.0;
double suma=0;
for(i=0; i<notas.length; i++)
{
System.out.println("Digite el valor de la nota= " + i + " ");
notas[i]=leer.nextDouble();
}
for(i=0; i<notas.length; i++)
{
System.out.println("La posicion " + i + " es = " + notas[i]);
}
for(i=0; i<notas.length; i++)
{
suma+=notas[i];
}
prom=suma/i;
System.out.println(" " );
System.out.println("El promedio de las notas es = " + prom);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment