Chapter 9 IM Answers

Chapter 9 IM Answers - An Introduction to Programming with...

Info iconThis preview shows pages 1–2. Sign up to view the full content.

View Full Document Right Arrow Icon

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: An Introduction to Programming with C++: Fifth Edition 978-1-4188-3618-4 Chapter 9 Answers CONCEPT LESSON REVIEW QUESTIONS 1. a value-returning 2. a one value only 3. d all of the above 4. c The name of each actual argument should be identical to the name of its corresponding formal parameter. 5. d a formal parameter 6. b } (closing brace) 7. c float calcTax(float salesAmount) 8. d double getFee(int base, double rate) 9. d double getFee(int, double); 10. d none of the above 11. d by value 12. b it removes the functions local variables (if any) from memory, then continues program execution with the statement that called the function 13. c scope 14. a The beginBalance variable remains in memory until the function ends. 15. a stores the result in the calcGross() functions pay variable 16. c pow(5.0, 3) 17. b 3 + rand() % (9 3 + 1) 18. c srand(static_cast<int>(time(0))); EXERCISES PENCIL AND PAPER 1. double halveNumber(int num) { return static_cast<double>(num) / 2.0; } //end of halveNumber function 2. char getCharacter() { char character = ; cout << Enter a character: ; cin >> character; return character; } //end of getCharacter function 3. double calcAverage(int n1, int n2, int n3, int n4)...
View Full Document

Page1 / 4

Chapter 9 IM Answers - An Introduction to Programming with...

This preview shows document pages 1 - 2. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online