% Strings.  Concatenation

var sentence: string := ""
var word: string

put "Please type a sequence of words followed by `quit'"

%
% Why have I written the code this way?
%

loop
	get word
	exit when word = "quit"
	if sentence = "" then
		sentence := word
	else
		sentence := sentence + " " + word
	end if
end loop

if sentence = "" then
	put "Hey, you didn't type a sentence!"
else
	sentence := sentence + "."
	put "The sentence you typed is:"
	put sentence
end if
