Skip to content

Instantly share code, notes, and snippets.

@titandiaz
Created April 4, 2016 02:18
Show Gist options
  • Select an option

  • Save titandiaz/ecb0a0bca9959988314bc7d20ca95782 to your computer and use it in GitHub Desktop.

Select an option

Save titandiaz/ecb0a0bca9959988314bc7d20ca95782 to your computer and use it in GitHub Desktop.
ClaseDeArreglos
package arrays;
import java.util.Scanner;
public class arrayEjercicioUno {
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