import javax.swing.JOptionPane; public class Agosto19 { public static void main(String[] args) { int array[]=new int ; String nombre; nombre=JOptionPane.showInputDialog("Ingresar Nombre Del Alumno" int sumn=0,sum = 0,nt,exp,exe; for(int x=0;x<5;x++){ do{ array[x]=Integer.parseInt(JOptionPane.showInputDialog("Ingresar Nota["+(x+1)+"]"); }while(array[x]<0||array[x]>20); sumn=sumn+array[x]; } array[5]=sumn/5; JOptionPane.showMessageDialog(null, array[5]); for(int x=6;x<9;x++){ do{ nt=Integer.parseInt(JOptionPane.showInputDialog("Ingresar Nota De Trabajo["+(x+1)+"]"); }while(nt<0|nt>20); sum=sum+nt; } array[9]=sum/3; JOptionPane.showMessageDialog(null,array[9] );
do{ exp=Integer.parseInt(JOptionPane.showInputDialog("Ingresar Nota De Examen Parcial"); }while(exp<0||exp>20); array[10]=exp; do{ exe=Integer.parseInt(JOptionPane.showInputDialog("Ingresar Nota De Prueba Escrita"); }while(exe<0||exe>20); array[11]=exe; array[12]=(array[5]+array[9]+array[10]+array[11])/4; JOptionPane.showMessageDialog(null,array[12] );
0 comentarios