-
Lenguaje
Pascal
-
Descripción
Una tienda ofrece un descuento del 25% sobre total sobre el total de la compra durante el mes de octubre. Dado un mes y un importe, calcular cual es la cantidad que se debe cobrar al cliente.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
program DescuentoDel25EnOctubre;
uses crt;
var cantidad_a_cobrar, descuento, importe, numero_de_mes : real;
begin
write ('Ingresa el valor de importe: ');
readln (importe);
write ('Ingresa el valor de numero de mes: ');
readln (numero_de_mes);
if numero_de_mes=11 then
begin
descuento := importe*0.25;
end
else
begin
descuento := 0;
end;
cantidad_a_cobrar := importe-descuento;
writeln ('Valor de cantidad a cobrar: ', cantidad_a_cobrar:0:6);
writeln ('Valor de descuento: ', descuento:0:6);
writeln;
write ('Presiona una tecla para terminar . . . ');
readkey;
end.
uses crt;
var cantidad_a_cobrar, descuento, importe, numero_de_mes : real;
begin
write ('Ingresa el valor de importe: ');
readln (importe);
write ('Ingresa el valor de numero de mes: ');
readln (numero_de_mes);
if numero_de_mes=11 then
begin
descuento := importe*0.25;
end
else
begin
descuento := 0;
end;
cantidad_a_cobrar := importe-descuento;
writeln ('Valor de cantidad a cobrar: ', cantidad_a_cobrar:0:6);
writeln ('Valor de descuento: ', descuento:0:6);
writeln;
write ('Presiona una tecla para terminar . . . ');
readkey;
end.