- import java.util.*; 
-   
- import org.jfree.chart.ChartFactory;  
- import org.jfree.chart.ChartFrame;  
- import org.jfree.chart.JFreeChart;  
- import org.jfree.data.general.DefaultPieDataset; 
-   
- public class Finalv1 { 
-   
-   
-     { 
-         int intentos = 0,op = 0; 
-         Scanner teclado  = new-  Scanner (System- . in);
-         String-  usuarioCorrecto  = "admin";
 
-         String-  contraseñaCorrecta  = "123";
 
-         String-  contraseñaIngresada  = "";
 
-   
-         System- . out- . println("Bienvenido a Gestion de Alumnos 1.0 ");
 
-         do 
-         { 
-   
-         	System- . out- . println("Ingrese Usuario: ");
 
-             usuarioIngresado = input.next(); 
-             System- . out- . println("Ingrese Contraseña: ");
 
-             contraseñaIngresada = input.next(); 
-             if (usuarioIngresado.equals(usuarioCorrecto) == false || contraseñaIngresada.equals(contraseñaCorrecta) == false || ((intentos <= 3))) 
-             { 
-             	intentos++; // contador para los intentos 
-             	if (usuarioIngresado.equals(usuarioCorrecto)  || 	contraseñaIngresada.equals(contraseñaCorrecta)) 
-                 { 
-             		System- . out- . println("Datos ingresados correctos");
 
-   
-                 } 
-             	else if (intentos < 3)/* Aca que se repitiera siempre y cuando los intentos sean menores  a 3*/  
-             	{ 
-             		System- . out-   . println("Error! usuario o contraseña incorrecta");
 
-             		} 
-             	else 
-             	{ 
-             // Y aca te manda el ultimatum si te equivocas 3 veces 
-             		System- . out- . println("Contacte con el soporte tecnico.");
 
-             		} 
-             	}   
-             } 
-         while (usuarioIngresado.equals(usuarioCorrecto) == false || contraseñaIngresada.equals(contraseñaCorrecta) == false); 
-         do{    
-   
-         	try{ 
-         		System- . out- . print("\n\nMenú principal \n\n1: Ingresar información  \n\n2: Datos de los Alumnos \n\n3: Grafica   \n\n4: Finalizar programa");
 
-         		System- . out- . println("\nSeleccione una opción del menú");
 
-         		op=input.nextInt(); 
-         			System- . out- . println("Error! ingrese una opción válida del menú");
 
-         			input.nextLine(); 
-         			} 
-   
-         	switch (op){ 
-         	case 1: ingreseDatos();	 
-         	break; 
-         	case 2:  
-         		try{ 
-         			mostrarDatos();	 
-         				System- . out- . println("Error todavia no se ha ingresado ningun dato Presione Cualquier tecla para volver");
 
- 						input.nextLine(); 
- 						}finally{	 
- 							break;} 
- 			case 3:  
- 				try{ 
- 					grafica() 
- 					;	 
- 						System- . out- . println("Error todavia no se ha ingresado ningun dato Presione Cualquier tecla para volver");
 
- 						input.nextLine(); 
- 						}finally{ 
- 							break;} 
- 			case 4: 
- 				System- . out- . println("Fin del programa");
 
- 			break; 
- 			default:  
- 				System- . out- . println("Error! ingrese una opción válida del menú");
 
- 				} 
-         	}while (op!=4 ); 
-         } 
-   
-     public static-  Scanner input  = new-  Scanner (System- . in);
 
-     public static String[]-  nombres ;
 
-     public static String-  nombreMayor ;
 
-     public static String-  nombreMenor ;
 
-     public static int[][] not1; 
-     public static int a = 0, f = 0, pos = 0, sumaPos = 0, r = 0, suma = 0, PromedioTMP = 0,nualumn = 0,promedioAlumn,promedioGral,sumaProm,promFin,cont1=0,cont2=0,cont3=0,cont4=0; 
-   
-     public static void ingreseDatos() 
-     { 
-     	try{  
-     		System- . out- . println("Cantidad de alumnos en el grupo: ");
 
-     		nualumn = input.nextInt();      
-     			input.nextLine(); 
-     			System- . out- . println("Error Numero invalido regresando al menu");
 
-     			} 
-     	nombres  = new String[- nualumn ];
-     	not1 = new int[nualumn][5]; 
-     	for (f = 0; f < nombres.length; f++) 
-     	{ 
-     		System- . out- . println("Ingrese nombre del alumno ");
 
-     		nombres[f] = input.next(); 
-   
-     		for (a = 0; a < 5; a++) 
-     		{ 
-     			while ( not1[f][a]   < 1 ||  not1[f][a]   > 12) 
-     			{ 
-     				try{ 
-     					System- . out- . println("Ingrese nota "+(- a +1));
 
-     					not1[f][a]   = input.nextInt(); 
-     					}catch(InputMismatchException e){ 
-                         input.nextLine(); 
-                         System- . out- . println("Error ingrese un numero valido");
 
-                         } 
-     				} 
-     			} 
-     		} System- . out- . println("Datos Ingresados Correctamente volviendo al Menu");
 
-     	} 
-   
-   
-   
-     private static void grafica() {  
-     	DefaultPieDataset dataset = new DefaultPieDataset();  
-     	dataset.setValue("Aprobados", cont1);  
-     	dataset.setValue("Desaprobados", cont2);  
-     	JFreeChart grafica = ChartFactory.createPieChart3D(  
-     			"Grafica de Aprobados y Desaprobados", // El nombre de la gráfica  
-     			dataset, // El arreglo de datos  
-     			false, // Indica si lleva leyenda  
-     			true, // Indica si lleva tooltips  
-     			false); // Indica si son URls  
-     	   // Mostramos la grafica en pantalla 
-     	ChartFrame frame = new ChartFrame("Graficador", grafica);  
-         frame.pack();  
-     	frame.setVisible(true);  
-     } 
-   
-   
-   
-   
-     // Opcion 3 de la lista 
-   
-     private static void mostrarDatos(){ 
-   
-   
-     	for (f = 0; f < nombres.length; f++) 
-     	{ 
-     		System- . out- . println("Alumno: " +-  nombres [- f ]);
 
-     		for (a = 0; a < 5; a++) 
-     		{ 
-     			System- . out- . println("Notas " +-  not1 [- f ][- a ]);
 
-     			}    
-     		} 
-     	for (f = 0; f < nombres.length; f++) 
-     	{     
-     		PromedioTMP = 0; 
-     		// Ciclo para recorrer las columnas 
-     		for (a = 0; a < 5; a++) 
-     		{     
-     			PromedioTMP = PromedioTMP + not1[f][a]; 
-     			} 
-     		promedioAlumn=PromedioTMP/5; 
-     		for( int i=0; i<nualumn; i++ ){  
-     			sumaProm+= promedioAlumn;  
-     			}  
-     		promFin=((sumaProm/nualumn)/nualumn); 
-   
-     		System- . out- . println("Promedio del alumno " +-  nombres [- f ] + ": "+-  promedioAlumn );
 
-   
-     		if(promedioAlumn>=7){ 
-     			cont1 = cont1 + 1; 
-     			System- . out- . println("Aprobado");
 
-     			} 
-     		else{ 
-     			System- . out- . println("Reprobado");
 
-             	cont2=cont2+1; 
-             	} 
-   
-     		}  
-   
-   
-     	int mayor[] = new int[nombres.length]; 
-     	int menor[] = new int[ nombres.length]; 
-   
-   
- 	        for (f = 0; f < nombres.length; f++) {  // 
- 	            for (a = 0; a < not1[f].length; a++) { 
- 	                if (not1[f][a] > mayor[f]) { 
- 	                    mayor[f] = not1[f][a]; 
- 	                    nombreMayor = nombres[f]; 
- 	                } else if (not1[f][a] < menor[f]) { 
- 	                    menor[f] = not1[f][a]; 
- 	                    nombreMenor = nombres[f]; 
- 	                } 
- 	            }            
- 	        } 
-   
-     	System- . out- . println("Mayor nota ingresada de la clase del alumno "+-  nombreMayor  + " " +-  mayor [- f ]);
 
-     	System- . out- . println("Menor nota ingresada de la clase del alumno "+-  nombreMenor  + " " +-  menor [- f ]);
 
-     	System- . out- . println("Promedio General de la Clase :  "+- promFin );
 
-     	} 
-     } 
-   
-