General Forum
Start a New Topic 
Author
Comment
View Entire Thread
Re: What punctuation do I need before the quotations? These are imperative sentences.

These are not imperative sentences i.e. they are not ordering anyone to do anything. The first, for example, is an invitation in the form of a suggestion.

Further, my impression is that these are being geared towards children, and so informal. Hence, I would agree in your not using capital letters at the start of each.

Here's what I would write:

Display the message: let's make an algorithm!
In red font, display the message: hello - how are you?

Omitting the quotation marks ensures that the programmer does not include them as part of the message displayed.

Re: What punctuation do I need before the quotations? These are imperative sentences.

(1) Display the message: "Let's make a sorting algorithm!"
(2) In red font, display the message: "Hello, how are you?"


Just two things to watch out for. Use a colon (or a comma) before the message details and start the message with a capital letter since it is a sentence in its own right. Surrounding the message itself with quotation marks is useful but optional.

The sentences are imperatives, as you say. This is abundantly clear from the fact that the verb "display" is a plain (infinitive) verb-form. Further, in (1), but not (2) the message itself is also an imperative - a special kind called a let-imperative.



PaulM