Skip to the content of the web site.

Lesson 2: Solutions

These are solutions to the posed questions; however, we ask that you make a serious effort at answering those questions first. If you simply jump to reading these solutions, please consider not going the University of Waterloo for your undergraduate studies: you will make neither a good student nor a good engineer.

1. If you do not include the space, the output is

Hello Muddah,hello Fadduh.
Here I am at Camp Granada.
Camp is very entertaining.
And they say we'll have some fun if it stops raining.

while if you add it, you get a space between the comma and the next word:

Hello Muddah, hello Fadduh.
Here I am at Camp Granada.
Camp is very entertaining.
And they say we'll have some fun if it stops raining.

The line std::cout << std::endl; goes to the start of the next line. The name endl is an abbreviation of end-of-line.

2. If you restrict your strings to English, you are restricting the audience of your application to only those who can speak English. Later, we will see how you can store multiple strings and then access the one related to the language of the user.