-
Lenguaje
Pascal
-
Descripción
Capture el precio de un artículo y si es mayor o igual a $200 haga un descuento del 15%.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
program DescuentoDel15;
uses crt;
var descuento, precio, total : real;
begin
write ('Ingresa el valor de precio: ');
readln (precio);
if precio>200 then
begin
descuento := precio*0.15;
end
else
begin
descuento := 0;
end;
total := precio-descuento;
writeln ('Valor de descuento: ', descuento:0:6);
writeln ('Valor de total: ', total:0:6);
writeln;
write ('Presiona una tecla para terminar . . . ');
readkey;
end.
uses crt;
var descuento, precio, total : real;
begin
write ('Ingresa el valor de precio: ');
readln (precio);
if precio>200 then
begin
descuento := precio*0.15;
end
else
begin
descuento := 0;
end;
total := precio-descuento;
writeln ('Valor de descuento: ', descuento:0:6);
writeln ('Valor de total: ', total:0:6);
writeln;
write ('Presiona una tecla para terminar . . . ');
readkey;
end.