The program has to encrypt a phrase that the user enters via the keyboard. For example: If you enter Hello as a phrase and 8 as a key, the program should return Encrypted: IIIH
The problem is that no result is shown on the screen.
SubProceso tado <- ascii ( Frase, clave)
Definir CodLet, g Como Cadenas;
CodLet <- "ABCDEFGHIJKLMNOPQRSTUVWXYZ";
Definir i, j, k, L Como Enteros;
clave <- 0;
Frase <- "";
k <-0;
Definir tado Como Cadena;
tado <- "";
Para i<-1 Hasta longitud(Frase) Con Paso 1 Hacer
g<-SubCadena(Frase, i, i);
Para j<-1 Hasta 26 Con Paso 1 Hacer
Si g=SubCadena(Codlet, j, j) Entonces
k<-j;
FinSi
FinPara
L<-(k+clave) % 27;
tado <-concatenar(tado,subcadena(CodLet, L, L));
FinPara
FinSubProceso
Proceso sin_titulo
Definir Frase Como Cadena;
Definir clave Como Entero;
Leer Frase;
Leer Clave;
Escribir ascii(Frase,Clave);
FinProceso