An Introduction to Programming with C++: Eighth Edition
Chapter 9 Answers
Review Questions
1. a one value only
2. d all of the above
3. c The name of each actual argument should be identical to the name of its corresponding formal
parameter.
4. d a formal parameter
5. c double calcTax(double salesAmount)
Exercises Pencil and Paper
1. The answer to this TRY THIS Exercise is located at the end of Chapter 9 in the book.
2. The answer to this TRY THIS Exercise is located at the end of Chapter 9 in the book.
3. answer = pow(3, 16);
{
char response = ‘ ‘;
cout << “Enter a character: “;
8. answer = sqrt(pow(x, 2) * pow(y, 3));
9. answer = pow(x / y, 4) 10;
10. double getSalesTax(double sold, char code, double rate)
Exercises Computer
11. The answer to this TRY THIS Exercise is located at the end of Chapter 9 in the book. The code is entered
in the TryThis11.cpp file, which is contained in either the Cpp8\Chap09\TryThis11 Project-IM folder
(Microsoft) or the Cpp8\Chap09 folder (non-Microsoft).
12. The answer to this TRY THIS Exercise is located at the end of Chapter 9 in the book. The code is entered
15. See the ModifyThis15.cpp file, which is contained in either the Cpp8\Chap09\ModifyThis15 Project-IM
folder (Microsoft) or the Cpp8\Chap09 folder (non-Microsoft).
16. See the Introductory16.cpp file, which is contained in either the Cpp8\Chap09\Introductory16 Project-IM
folder (Microsoft) or the Cpp8\Chap09 folder (non-Microsoft).
17. See the Introductory17.cpp file, which is contained in either the Cpp8\Chap09\Introductory17 Project-IM
folder (Microsoft) or the Cpp8\Chap09 folder (non-Microsoft).
18. See the Introductory18.cpp file, which is contained in either the Cpp8\Chap09\Introductory18 Project-IM
folder (Microsoft) or the Cpp8\Chap09 folder (non-Microsoft).
19. See the Intermediate19.cpp file, which is contained in either the Cpp8\Chap09\ Intermediate19 Project-IM
folder (Microsoft) or the Cpp8\Chap09 folder (non-Microsoft).
20. See the Intermediate20.cpp file, which is contained in either the Cpp8\Chap09\Intermediate20 Project-IM