-
Lenguaje
Pascal
-
Descripción
Una empresa de pintura cobra por un cuñete de pintura $150,000, le da un descuento del 15% a quien facture más de $1,500,000 y menos de $1,999,999, 20% a quien facture más de dos millones en adelante y nada a quien facture menos de millón y medio.
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
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
program DescuentoEnPintura;
uses crt;
var cunetes_de_pintura, descuento, facturacion, total : real;
begin
write ('Ingresa el valor de cunetes de pintura: ');
readln (cunetes_de_pintura);
facturacion := cunetes_de_pintura*150000;
descuento := 0;
if (facturacion>1500000) and (facturacion<2000000) then
begin
descuento := facturacion*0.15;
end;
if facturacion>=2000000 then
begin
descuento := facturacion*0.2;
end;
total := facturacion-descuento;
writeln ('Valor de descuento: ', descuento:0:6);
writeln ('Valor de facturacion: ', facturacion:0:6);
writeln ('Valor de total: ', total:0:6);
writeln;
write ('Presiona una tecla para terminar . . . ');
readkey;
end.
uses crt;
var cunetes_de_pintura, descuento, facturacion, total : real;
begin
write ('Ingresa el valor de cunetes de pintura: ');
readln (cunetes_de_pintura);
facturacion := cunetes_de_pintura*150000;
descuento := 0;
if (facturacion>1500000) and (facturacion<2000000) then
begin
descuento := facturacion*0.15;
end;
if facturacion>=2000000 then
begin
descuento := facturacion*0.2;
end;
total := facturacion-descuento;
writeln ('Valor de descuento: ', descuento:0:6);
writeln ('Valor de facturacion: ', facturacion:0:6);
writeln ('Valor de total: ', total:0:6);
writeln;
write ('Presiona una tecla para terminar . . . ');
readkey;
end.