Created
April 4, 2016 02:18
-
-
Save titandiaz/ecb0a0bca9959988314bc7d20ca95782 to your computer and use it in GitHub Desktop.
ClaseDeArreglos
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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