Integer, + - * DIV MOD, IF, FOR, WHILE, RdInt, WrInt.
MODULE D1;
<* NOOPTIMIZE + *>
FROM IO IMPORT RdChar, RdKey, WrChar, WrStr,
WrLn, RdStr, RdLn, WrCard; (* import general
procedures
*)
CONST STRING_SIZE = 10; (* constants *)
VAR a:
CHAR;
(* variable-declarations *)
word:
ARRAY[1..STRING_SIZE]
OF CHAR;
i : CARDINAL;
BEGIN
WrLn;
WrStr("Please give me a character: ");
a := RdChar();
WrLn;
WrStr("Please give me a word of max 10
characters:
");
RdStr(word);
WrLn;
(* check *)
IF (word[2] = 'a') OR (word[2] = 'e') OR
(word[2]
= 'i') OR (word[2] = 'u') OR (word[2] = 'o') THEN
word[2] := a; (* note the
difference between the letter 'a' and the variable a !!*)
END;
(* print word *)
WrStr("This is your word: ");
WrStr(word);
WrLn;
END D1.