For the material covered today (based on Sections 2.6 and 6.3), I'm assigning one problem that is based on "Project 2.B" on pag 91 in the book, but adapted to how the example was modified for class. Enter this into the automated grading system as "6.3.x".
6.3.x.
Following the pattern for makeInterrogative
,
write a function makeImperative
and
appropriate helper functions that transforms and prints
the sentence into the imperative mood.
The verb should be in an appropriate place, and the
subject should be vocative (basically, replace the
article with "O").
For example, the sentence
"the big dog quickly chased a red ball through the bright field"
would be transformed into
"chase a red ball quickly through the bright field,
o big dog!".
A few details to note:
"
, not slanted quotes like “
and ”.
If the editor you're using automatically makes quotes slanted (often called
"smart quotes"), you'll need to turn it off.
Let me know if you need help with that.
For example, here are instructions about how to disable smart quotes
for recent versions of MacOS.
(* "Feature presentation" begins here *)
),
but not when submitting your solution.
On the other hand, when you submit, don't forget to include the
helper functions that you wrote or completed, namely
imperativeT(), imperativeI(), imperativeL(),
and printVocative()
in addition to, of course,
the function makeImperative()
.