-
Lenguaje
Pascal
-
Descripción
Calcular el pago final de los siguientes datos:
1- Si el cliente es el tipo 1 se hace un descuento de 30%.
2- Si el cliente es el tipo 2 se hace un descuento de 90%.
3- Si el cliente es el tipo 3 se hace un descuento de 10%.
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
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
program DescuentoYPagoPorTipoDeCliente;
uses crt;
var descuento, importe, pago_final, tipo_de_cliente : real;
begin
write ('Ingresa el valor de importe: ');
readln (importe);
write ('Ingresa el valor de tipo de cliente: ');
readln (tipo_de_cliente);
descuento := 0;
if tipo_de_cliente=1 then
begin
descuento := importe*0.3;
end;
if tipo_de_cliente=2 then
begin
descuento := importe*0.9;
end;
if tipo_de_cliente=3 then
begin
descuento := importe*0.1;
end;
pago_final := importe-descuento;
writeln ('Valor de descuento: ', descuento:0:6);
writeln ('Valor de pago final: ', pago_final:0:6);
writeln;
write ('Presiona una tecla para terminar . . . ');
readkey;
end.
uses crt;
var descuento, importe, pago_final, tipo_de_cliente : real;
begin
write ('Ingresa el valor de importe: ');
readln (importe);
write ('Ingresa el valor de tipo de cliente: ');
readln (tipo_de_cliente);
descuento := 0;
if tipo_de_cliente=1 then
begin
descuento := importe*0.3;
end;
if tipo_de_cliente=2 then
begin
descuento := importe*0.9;
end;
if tipo_de_cliente=3 then
begin
descuento := importe*0.1;
end;
pago_final := importe-descuento;
writeln ('Valor de descuento: ', descuento:0:6);
writeln ('Valor de pago final: ', pago_final:0:6);
writeln;
write ('Presiona una tecla para terminar . . . ');
readkey;
end.