Hello everyone I am working on a secruity program Demo. The program should allow the user to enter a message, one character at a time. The program should then display the corresponding digit or punctuation according to the ASCII character set. For example, if the user enters the letter a, the program would display the character ! (exclamation point). The program should run until the user enters a character that is not one of the corresponding digits or punctuations.
Here is what I got so Far and its a little off
program SecurityCode;
#include( "stdlib.hhf" )
static
c:char;
begin SecurityCode;
stdout.put( "Enter in a short line of text ");
stdin.flushInput();
//This will repeat until it goes through all of the text entered
repeat
stdin.getc();
//Checks to see if the char is uppercase,
// changes them, then converts to ASCII
if( al >= 'A' && al <= 'Z' ) then
or( $20, al );
and( $BF, al );
stdout.putc( al );
//converts lowercase letters to ASCII
elseif( al >= 'a' && al <= 'z' ) then
and( $BF, al );
stdout.putc( al );
//everything else gets printed out
else
stdout.putc( al );
endif;
until( stdin.eoln() );
end SecurityCode;
It isnt accepting one character at a time and I am confused on how to do this. any help would be appreciated.
thanks