Question: 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

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);

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!