No puedo sacar el importe total de las facturas
Publicado por Martín (6 intervenciones) el 08/05/2020 00:56:47
Hola, buenas tardes, tengo un problema no puedo sacar el importe total de las facturas queria saber si me podrian decir cual es el error que cometi y la solucion
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
var
NF,d,m,a,CP,imp,acumulador,total,reg,ac,cont,TF:integer;
DP,continuar,items:char;
begin
continuar:='s';
while continuar='s' do
begin
writeln('REGISTRO DE FACTURAS');
write('Ingrese Numero de factura: ');
readln(NF);
write('Ingrese dia: ');
readln(d);
write('Ingrese mes: ');
readln(m);
write('Ingrese ano: ');
readln(a);
acumulador:=0;
total:=0;
cont:=0;
TF:=0;
ac:=0;
repeat
write('Ingrese el Codigo del producto: ');
readln(CP);
write('Describa el producto: ');
readln(DP);
repeat
write('Ingrese el importe: ');
readln(imp);
if(imp<0)then
writeln('ERROR,por favor ingrese un valor positivo')
else
acumulador:=imp+acumulador;
total:=acumulador;
until(imp>0);
write('¿Desea agregar mas items?(s/n) ');
readln(items);
until(items='n') ;
writeln('Total Factura: ',total);
total:=imp+ac;
TF:=total;
write('¿Desea agregar otra factura?(s/n) ');
readln(continuar);
if(continuar='s')then
reg:=cont+1;
end;
writeln('Se registraron ',reg+1,'facturas con un importe total de ',TF,'pesos');
readln;
end.
Valora esta pregunta


0