-
Lenguaje
Pascal
-
Descripción
Digite el nombre del cliente, la cantidad en soles a cambiar y el tipo de moneda a la que se desea cambiar, en este caso sólo será dólares o euros, se deberá visualizar la cantidad en la moneda extranjera cambiada.Tenga en cuenta el siguiente tipo de cambio $1 = S/ 2.5y €1 = S/ 3.85.
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
30
31
32
33
34
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
30
31
32
33
34
program SolesAEurosODolares;
uses crt;
var tipo_de_moneda : integer;
var cantidad_cambiada, soles : real;
var nombre_del_cliente : string;
begin
write ('Ingresa el nombre del cliente: ');
readln (nombre_del_cliente);
write ('Ingresa el valor de soles: ');
readln (soles);
writeln ('Selecciona el valor de tipo de moneda.');
writeln (' 1.- D'#162'lares');
writeln (' 2.- Euros');
write (' : ');
repeat
readln (tipo_de_moneda);
if (tipo_de_moneda<1) or (tipo_de_moneda>2) then
write ('Valor incorrecto. Ingr'#130'salo nuevamente.: ');
until (tipo_de_moneda>=1) and (tipo_de_moneda<=2);
if tipo_de_moneda=1 then
begin
cantidad_cambiada := soles/2.5;
end
else
begin
cantidad_cambiada := soles/3.85;
end;
writeln ('Nombre del cliente: ', nombre_del_cliente);
writeln ('Valor de cantidad cambiada: ', cantidad_cambiada:0:6);
writeln;
write ('Presiona una tecla para terminar . . . ');
readkey;
end.
uses crt;
var tipo_de_moneda : integer;
var cantidad_cambiada, soles : real;
var nombre_del_cliente : string;
begin
write ('Ingresa el nombre del cliente: ');
readln (nombre_del_cliente);
write ('Ingresa el valor de soles: ');
readln (soles);
writeln ('Selecciona el valor de tipo de moneda.');
writeln (' 1.- D'#162'lares');
writeln (' 2.- Euros');
write (' : ');
repeat
readln (tipo_de_moneda);
if (tipo_de_moneda<1) or (tipo_de_moneda>2) then
write ('Valor incorrecto. Ingr'#130'salo nuevamente.: ');
until (tipo_de_moneda>=1) and (tipo_de_moneda<=2);
if tipo_de_moneda=1 then
begin
cantidad_cambiada := soles/2.5;
end
else
begin
cantidad_cambiada := soles/3.85;
end;
writeln ('Nombre del cliente: ', nombre_del_cliente);
writeln ('Valor de cantidad cambiada: ', cantidad_cambiada:0:6);
writeln;
write ('Presiona una tecla para terminar . . . ');
readkey;
end.