3 | Printing Quotes |
Quotation marks are often used to denote the start and end of a string. But sometimes we need to print out the quotation marks themselves by using escape characters.
Create a program that prompts for a quote and an author. Display the quotation and author as shown in the example output.
Example Output
| What is the quote? These aren't the droids you're looking for. |
| Who said it? Obi-Wan Kenobi |
| Obi-Wan Kenobi says, "These aren't the droids |
| you're looking for." |
Constraints
-
Use a single output statement to produce this output, using appropriate string-escaping techniques for quotes.
-
If your language supports string interpolation or string substitution, don’t use it for this exercise. Use string concatenation instead.
Challenge
-
In ...
Get Exercises for Programmers now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.