Assume a program contains a void function named


Question 1

Assume a program contains a void function named calcNewPrice(). The function receives two double variables named oldPrice and newPrice. The function multiplies the contents of the oldPrice variable by 1.1, then stores the result in the newPrice variable. Which of the following can be used to call the calcNewPrice() function?

A. calcNewPrice(double oldPrice, double newPrice);

B.calcNewPrice(&oldPrice, newPrice);

C. calcNewPrice(oldPrice, &newPrice);

D. calcNewPrice(oldPrice, newPrice);

Question 2

Assume a program contains a void function named calcNewPrice(). The function receives two double variables named oldPrice and newPrice. The function multiplies the contents of the oldPrice variable by 1.1, then stores the result in the newPrice variable. Which of the following is the best function prototype for this function?

A. void calcNewPrice(double oldPrice, double newPrice);

B. void calcNewPrice(double &oldPrice, double newPrice);

C. void calcNewPrice (double oldPrice, double &newPrice);

D. void calcNewPrice(double &oldPrice, double &newPrice);

Request for Solution File

Ask an Expert for Answer!!
Computer Engineering: Assume a program contains a void function named
Reference No:- TGS02909509

Expected delivery within 24 Hours