It is known that the number of students is 10.
You should be able to enter:
a. Student ID b. Career (w - Technician in Development of Web Applications; - Technician in Development of Mobile apps) c. First Partial Note d. Second Partial Note and. Note Practical Work
It must be calculated:
a. Average grade for each student b. Number of students of the Technician in Development of Web Applications c. Number of students of the Technician in Development of Mobile Applications d. Average Web notes and. Average mobile notes
* I do not know how to do the average of Web and Mobile notes. Since the way I did it gives me any result.
int alumnos = 10;
int dni = 0;
String carrera = " ";
int parcial1W=0;
int parcial1M=0;
int parcial2W=0;
int parcial2M=0;
int notaTPW =0;
int notaTPM =0;
int promedioW = 0;
int promedioM = 0;
int cantidadAlumMobile = 0;
int cantidadAlumWeb=0;
int promedioWeb=0;
int sumaW =0;
int sumaM=0;
int sumatoriaPW = 0;
int sumatoriaPM=0;
int promedioNWeb =0;
int promedioNMobile=0;
Scanner teclado = new Scanner (System.in);
for (int i = 1; i < alumnos; i++) {
System.out.println(i+".Ingrese DNI : ");
dni = teclado.nextInt();
System.out.println(i+".Ingrese Carrera : ");
carrera = teclado.next();
switch(carrera) {
case "Web":
System.out.println(i+".Ingrese nota del 1er parcial : ");
parcial1W = teclado.nextInt();
System.out.println(i+"Ingrese nota del 2do parcial : ");
parcial2W = teclado.nextInt();
System.out.println(i+"Ingrese nota del T.P : ");
notaTPW = teclado.nextInt();
sumaW = parcial1W + parcial2W + notaTPW ;
promedioW = sumaW/3;
System.out.println(i+".Promedio : "+promedioW);
cantidadAlumWeb++;
promedioW++;
break;
case "Mobile" :
System.out.println(i+".Ingrese nota del 1er parcial : ");
parcial1M = teclado.nextInt();
System.out.println(i+"Ingrese nota del 2do parcial : ");
parcial2M = teclado.nextInt();
System.out.println(i+"Ingrese nota del T.P : ");
notaTPM = teclado.nextInt();
sumaM = parcial1M + parcial2M + notaTPM;
promedioM = sumaM/3;
System.out.println(i+".Promedio : "+promedioM);
cantidadAlumMobile++;
promedioM++;
break;
default :
System.out.println("Error! Carrera Inexistente.");
break;
}
sumatoriaPW+=promedioW;
sumatoriaPM+=promedioM;
}
promedioNWeb = sumatoriaPW / cantidadAlumWeb;
promedioNMobile = sumatoriaPM / cantidadAlumMobile;
System.out.println("Promedio Notas WEB : "+promedioNWeb);
System.out.println("Promedio Notas Mobile : "+promedioNMobile);
System.out.println("Cantidad de alumnos en Tec.Web : "+cantidadAlumWeb);
System.out.println("Cantidad de alumnos en Tec.Mobile : "+cantidadAlumMobile);