3. How to interact with AI

3.4. Examples of prompts

Output:

 

Output:

 

Output:

Output:

Output:

Program lettera;
Uses crt;
var cont:integer;
letter:char;
Begin clrscr;
writeln(‘As counter. Write a line ending in a full stop’); writeln(‘__________________________________________________’);
cont:=0;
read(letter);
while (letter<>‘.’) ;
begin if ((letter=‘a’) or (letter=‘A’)) then begin cont:=cont+1;
end; read(letter);
end;
write(‘Amount of As: ‘,cont); readkey;
end.

Output:

The program should now correctly count the number of “a” characters (lowercase or uppercase) before the full stop marking the end of the entry.