Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Write a program that declares three one-dimensional arrays named price, quantity

ID: 3655496 • Letter: W

Question

Write a program that declares three one-dimensional arrays named price, quantity, and amount. Each array should be declared in main() and be capable of holding 10 double-precision numbers. The numbers to be stored in price arc 10.62, 14.89, 13.21, 16.55, 18.62, 9.47, 6.58, 18.32, 12.15, and 3.98. The numbers to be stored in quantity are 4, 8.5, 6, 7.35, 9, 15.3, 3, 5.4, 2.9, and 4.8. Have your program pass these three arrays to a function called extend (), which calculates the elements in the amount array as the product of the equivalent elements in the price and quantity arrays: for example, amount [1] = price [1] * quantity [1]. After extend () has put values in the amount array, display the values in the array from within main(). Write the extend() function by using pointers.

Explanation / Answer

#include #include using namespace std; void extend(double *p,double *q,double *a){ for(int i=0;i
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote