How to print the matrix with the data?

-1

a Bank, wants to update its control program budget. The amount of the budget and the reservation must always be entered. Allowed register a maximum of ten (10) expenses. Use a matrix to save the next information on each expense: description of the expense, amount of the expense, available balance. Again, use a cycle that allows the expenses to enter but ends when the user wants it or when the available balance reaches zero.

    
asked by Adrián Gómez 14.08.2018 в 06:06
source

2 answers

0

Totally okay, it was my mistake I'm sorry.

Here is what I did but at the time of printing the matrix I do not print it, I do not know what I'm doing wrong, thanks.

Algoritmo banco

        Definir presupuesto, reserva, monto, saldo, diferencia, gastos como real;

        definir gasto, matriz, info, s Como Caracter;
        definir i, j como entero;
        dimension matriz[10,3];
        Dimension gasto[10];
        dimension monto[10];
        Dimension saldo[10];
        info<-"";
        s<-"";
        i<-0;
        j<-0;
        Escribir "Ingrese el presupuesto ";
        leer presupuesto;
        escribir "Ingrese la reserva: ";
        leer reserva;
        Escribir "";
        diferencia<-presupuesto-reserva;
        Repetir

            escribir "Disponible  ",diferencia Sin Saltar;
            Escribir "";
            Escribir sin saltar "Gasto No.: ",(i+1) Sin Saltar;
            Escribir"";
            Escribir "Descripcion ";
            leer gasto[i];
            Escribir "Monto: ";
            leer monto[i];
            Escribir "";
            diferencia<-diferencia-monto[i];
            Escribir "¿Desea salir? S/N ";
            leer s;
            saldo[i]<-diferencia;
        hasta Que s="si" o i=10

        Escribir "No.      Descripcion       monto    Nuevo saldo" Sin Saltar;
        Escribir"";
        para i<-1 hasta 10 con paso 1 hacer
         escribir i+1, "            ", gasto[i],"         ", monto[i],"           ", saldo[i],"   ";
        FinPara
FinAlgoritmo
    
answered by 14.08.2018 в 06:43
0

I have tested your code and it tells me that the failure is in the condition of "Repeat until".

Try changing that line to this other hasta Que s="si" | i=10 and then running the program, Regards.

    
answered by 16.10.2018 в 10:12