Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- program llamadas;
- uses crt;
- VAR
- Dur, N1, P1, L1, Cont0, Cont01 : Integer;
- RE, RE2, Cont1, Cont2, Cont3 : Real;
- Tipo, Chos : Char;
- BEGIN
- Clrscr;
- RE := 0;
- Dur := 0;
- N1 := 0;
- P1 := 0;
- L1 := 0;
- Cont01 := 0;
- repeat
- repeat
- write('Duracion de la llamada (0 para terminar): ');
- readln(Dur);
- write('Introduzca el tipo de llamada. N:Nacional, P:Provincial, L:Local : ');
- read(Tipo);
- if (Tipo = 'N') or (Tipo = 'n') then
- BEGIN
- N1 := N1+1;
- Cont1 := Cont1+Dur
- END;
- if (Tipo = 'P') or (Tipo = 'p') then
- BEGIN
- P1 := P1+1;
- Cont2 := Cont2+Dur
- END;
- if (Tipo = 'L') or (Tipo = 'l') then
- BEGIN
- L1 := L1+1;
- Cont3 := Cont3+Dur
- END;
- Cont01 := Cont01+1;
- Cont0 := Cont0+Dur;
- RE := RE+Dur;
- until Dur = 0;
- if (Dur = 0) then
- BEGIN
- Cont01 := Cont01-1
- END;
- RE2 := RE/Cont01;
- writeln(' -Especificacion llamadas Nacionales, Provinciales y Locales-');
- writeln('El numero de llamadas nacionales a sido: ', N1, ' y su duracion: ', Cont1:0:2);
- writeln('El numero de llamadas provinciales a sido: ', P1, ' y su duracion: ', Cont2:0:2);
- writeln('El numero de llamadas locales a sido: ', L1, ' y su duracion: ', Cont3:0:2);
- writeln();
- writeln(' -Totales- ');
- writeln('>Numero de llamadas: ', Cont01);
- writeln('>Duracion total : ', RE:0:1);
- writeln('>Duracion media : ', RE2:0:1);
- writeln();
- write('Desea continuar para realizar otra lista de llamadas? (S/N): ');
- read(Chos)
- until (Chos = 'n') or (Chos = 'N');
- END.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement