I am doing an exercise in which I must enter glucose measurements, before I start I must enter the number of patients to enter then I must register the name and number of the patient's card, then fill the data of the measurements in a matrix [6,2], then show the data of each patient, the problem is that I do not know how to do so that each matrix has the respective data of each patient since as I have it it manages to show the patients with their respective cedula numbers but the data of the matrix of all are the same, that is, only the data of the last patient that arrives gets me: this is the code in case someone can help me:
Proceso principal
Escribir matriz();
FinProceso
SubProceso medicion <- matriz()
Definir k,j,arreglo,i,N,C como entero;
Definir P Como caracter;
Dimension arreglo[6,2];
Dimension P[40];
Dimension C[12];
Escribir "Introduza la cantidad de pacientes a registrar";
Leer N;
Para i<-0 Hasta N-1 Con Paso 1 Hacer
Escribir "Introduzca el nombre del paciente";
Leer P[i];
Escribir "Introduzca la cédula del paciente";
Leer C[i];
Para k<-0 Hasta 5 Con Paso 1 Hacer
Para j<-0 Hasta 1 Con Paso 1 Hacer
Escribir "Introduzca primero la medición prepandial, luego la posprandial, en ese orden";
Leer arreglo[k,j];
FinPara
FinPara
FinPara
Para i<-0 Hasta N-1 Con Paso 1 Hacer
Para k<-0 Hasta 5 Con Paso 1 Hacer
Para j<-0 Hasta 1 Con Paso 1 Hacer
Escribir "El paciente ",P[i]," cédula ",C[i]," ",arreglo[k,j];
FinPara
FinPara
FinPara
FinSubProceso