Help with algorithm in Pseint

0

I need to do this exercise in Pseint.

There is a matrix of size 2 * 10, which represents the 2 qualifications (subjects) of 10 students. develop an algorithm that finds and prints:

  • Average winners' rating

  • Total students who must enable subject 1

  • Total students who must enable the 2 subjects

  • The average of each student and fill a vector with the averages

  • Total students who won all subjects

  • I specifically need help with point 3, which I have not yet been able to program.

    Thanks

    At the moment this is the code that has

    Algoritmo Promedio2materias
    
        a<-2;
        Dimension mt[2,2], mtpro[1,1],vec(a),mg[2,2]
        Definir i,j Como Entero;
        promedio<-0;
        sumaganadores<-0;
        contadorganaron<-0;
        //sumahabilitanmat1<-0;
        habilitanmat1<-0;
        habilitanmat2<-0;
        ganaronmat1<-0;
        ganaronmat2<-0;
        ganarontodas<-0;
        habilitantodas<-0;
    
        Para i<-1 Hasta 2 Hacer
            Para j<-1 Hasta 2 Hacer
                Escribir 'Ingrese valor para la fila ',i,', y para la columna ',j,':';
                Leer mt[i,j]
                //escribir mt[i,j]
                //aa<-mt[i,j]
                //Escribir j;
                Si mt[i,j] >= 3 Entonces
                    sumaganadores<-sumaganadores + mt[i,j]
                    contadorganaron<-contadorganaron + 1;
                    promedio<-sumaganadores / contadorganaron;
                Fin Si
            Fin Para
        Fin Para
    
        Escribir ("");
        // MOSTRAR VALORES DE CADA CELDA
        Para i<-1 Hasta 2 Hacer
            Para j<-1 Hasta 2 Hacer
                Escribir Sin Saltar mt[i,j], " ";            
            FinPara
            Escribir " "
        FinPara
    
        //RECORRER LOS VALORES DE LAS COLUMNAS
        Para x<-1 Hasta 2 Hacer
            sumacolumnas <- 0
            Para yy<-1 Hasta 2 Hacer
                vlrcolum1 <- mt[yy,x];
                Si yy = 1 Entonces
                    Si mt[yy,x] <= 2.9 Entonces
                        habilitanmat1 <- habilitanmat1 + 1;
                    SiNo
                        ganaronmat1 <- ganaronmat1 + 1;
                    FinSi
                    //Escribir ("Los valores de la columna "), x, " son: ", vlrcolum1, " ", vlrcolum2;
                Sino
                    Si mt[yy,x] <= 2.9 Entonces
                        habilitanmat2 <- habilitanmat2 + 1;
                    SiNo
                        ganaronmat2 <- ganaronmat2 + 1;
                    FinSi
                Fin Si
    
                Si ganaronmat1 = ganaronmat2  Entonces
                    ganarontodas <- ganaronmat1;
                Fin Si
    
                //Escribir ("ff"), x,  yy;
            Fin Para
    
            //Escribir ("ff"), x,yy;
        Fin Para
    
        Escribir ("");
        //Escribir sumaganadores;
        Escribir ("La nota promedio de los estudiantes que ganarón es de: "), promedio;
        Escribir ("La cantidad de estudiantes que deben habilitar la materia 1 es de: "), habilitanmat1;
        Escribir ("La cantidad de estudiantes que deben habilitar la materia 2 es de: "), habilitanmat2;
        Escribir ("La cantidad de estudiantes que deben habilitar las 2 materias es de: "), habilitantodas;
        //Escribir  habilitantodas,ganarontodas;
    
    FinAlgoritmo
    
        
    asked by Jassan 12.10.2018 в 23:37
    source

    0 answers