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...


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<br>In this exercise, you use what you have learned about passing arguments by reference and by<br>address to functions to answer Questions 1-2.<br>Given the following variable and function declarations, write the function call and<br>the function's header:<br>1.<br>a. double price<br>void changePrice(double&, double);<br>= 22.95, increase = .10;<br>b. double price<br>= 22.95, increase = .10;<br>void changePrice(double* , double);<br>C. int age = 23;<br>void changeAge(int&);<br>d. int age = 23;<br>void changeAge(int*);<br>Scanned by TapScanner<br>CHAPTER 9<br>Advanced Modularization Techniques<br>2.<br>Given the following function headers and variable declarations, write a function call:<br>{

Extracted text: 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[])
Jun 10, 2022
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here