Hello, I am not an expert programmer, but I am trying to teach my students how to create a program that calculates the average of n number of subjects.
i.e. Proceso promCali
Escribir "¿Cuántas materias tienes? "
Leer numMaterias
acum=0
Para i<-1 Hasta numMaterias Hacer
Escribir "Escribe el promedio de la materia ",i,":"
Leer valorMat
acum=acum+valorMat
Fin Para
promedio=acum/numMaterias
Escribir "Tu promedio con ",i-1," número de materias es: ",promedio
FinProceso
I already created a design, and I am trying to use the for cycle in AI2, but the difficult part is when we have to ask how many subjects you want to include in the average. Do I have to create more than one screen?
Could you help me to find a solution? Thanks in advance and have a very nice day :)