| 1. | How do you cause the cursor to move to the next line when performing screen output? | |
| 2. | What does the escape key \b do? | |
| 3. | How would you direct input from the keyboard to a variable called amountentered? | |
| 4. | To use cin, you must import what file? | |
| 5. | Is this statement/expression correct: cout>> "Hello World"; | |
| 6. | What does the escape key \t do? | |
| 7. | How would you output a literal text such as “The answer is” and the variable that holds the answer (let’s call it answer) on the same line? | |
| 8. | How would you create a new line if you were writing code in C instead of C++? | |
| 9. | How would you put literal quotes in your output? | |
| 10. | What is the purpose of the setf function? | |
Answers
| 1. | Using the \n escape key |
| 2. | Causes a backspace |
| 3. | cin >> amountentered; |
| 4. | # include <iostream.h> |
| 5. | No, the arrows (>>) point the wrong way. |
| 6. | Causes a horizontal tab |
| 7. | cout << "the answer is " << answer; |
| 8. | The same way as C++. The escape characters work the same in both languages. |
| 9. | You would use the \" escape character. |
| 10. | It sets the flags for formatting output. |