Exercise 9-6: Pass by Reference and Pass by Address In this exercise, you use what you have learned about passing arguments by reference and by address to functions to answer Questions 1-2. 1. Given the following variable and function declarations, write the function call and the function's header a. double price 22.95, increase .10; void changePrice(doubl e&, double); b. double price 22.95, increase .10; void changePrice (double*, double); c. int age = 23; void changeAge(int&); d. int age 23; void changeAge (int*); 2. Given the following function headers and variable declarations, write a function call: a. custNames [] = {"Perez", "Smith", "Patel", "Shaw"}; balances [] = {34.00, 21.00, 45.50, 67.00); void cust (string name [], double bal []) b. int values [] = {1, 77, 89, 321, -2, 34}: void printSum (int nums [])
Exercise 9-6: Pass by Reference and Pass by Address
In this exercise, you use what you have learned about passing arguments by reference and by
address to functions to answer Questions 1-2.
1. Given the following variable and function declarations, write the function call and
the function's header
a. double price 22.95, increase .10;
void changePrice(doubl e&, double);
b. double price 22.95, increase .10;
void changePrice (double*, double);
c. int age = 23;
void changeAge(int&);
d. int age 23;
void changeAge (int*);
2. Given the following function headers and variable declarations, write a function call:
a. custNames [] = {"Perez", "Smith", "Patel", "Shaw"};
balances [] = {34.00, 21.00, 45.50, 67.00);
void cust (string name [], double bal [])
b. int values [] = {1, 77, 89, 321, -2, 34}:
void printSum (int nums [])
![Exercise 9-6: Pass by Reference and Pass by Address
In this exercise, you use what you have learned about passing arguments by reference and by
address to functions to answer Questions 1-2.
Given the following variable and function declarations, write the function call and
the function's header:
1.
a. double price
void changePrice(double&, double);
= 22.95, increase = .10;
b. double price
= 22.95, increase = .10;
void changePrice(double* , double);
C. int age = 23;
void changeAge(int&);
d. int age = 23;
void changeAge(int*);
Scanned by TapScanner
CHAPTER 9
Advanced Modularization Techniques
2.
Given the following function headers and variable declarations, write a function call:
{"Perez", "Smith", "Patel", "Shaw"};
a. custNames[] =
balances [] = {34.00, 21.00, 45.50, 67.00};
void cust(string name[], double bal[])
b. int values[] = {1, 77, 89, 321, -2, 34};
void printSum(int nums[])](/v2/_next/image?url=https%3A%2F%2Fcontent.bartleby.com%2Fqna-images%2Fquestion%2Fdbfd89d3-1bed-499b-be69-f7ebb170e798%2F1c986da0-15a8-4b02-9771-3ebe5d2cf733%2F3lkeg7h_processed.jpeg&w=3840&q=75)
![](/static/compass_v2/shared-icons/check-mark.png)
Step by step
Solved in 2 steps
![Blurred answer](/static/compass_v2/solution-images/blurred-answer.jpg)
![Computer Networking: A Top-Down Approach (7th Edi…](https://www.bartleby.com/isbn_cover_images/9780133594140/9780133594140_smallCoverImage.gif)
![Computer Organization and Design MIPS Edition, Fi…](https://www.bartleby.com/isbn_cover_images/9780124077263/9780124077263_smallCoverImage.gif)
![Network+ Guide to Networks (MindTap Course List)](https://www.bartleby.com/isbn_cover_images/9781337569330/9781337569330_smallCoverImage.gif)
![Computer Networking: A Top-Down Approach (7th Edi…](https://www.bartleby.com/isbn_cover_images/9780133594140/9780133594140_smallCoverImage.gif)
![Computer Organization and Design MIPS Edition, Fi…](https://www.bartleby.com/isbn_cover_images/9780124077263/9780124077263_smallCoverImage.gif)
![Network+ Guide to Networks (MindTap Course List)](https://www.bartleby.com/isbn_cover_images/9781337569330/9781337569330_smallCoverImage.gif)
![Concepts of Database Management](https://www.bartleby.com/isbn_cover_images/9781337093422/9781337093422_smallCoverImage.gif)
![Prelude to Programming](https://www.bartleby.com/isbn_cover_images/9780133750423/9780133750423_smallCoverImage.jpg)
![Sc Business Data Communications and Networking, T…](https://www.bartleby.com/isbn_cover_images/9781119368830/9781119368830_smallCoverImage.gif)