Create a C++ program that declares three single-dimensional arrays named volts, current, and resistance. Each array should be declared in main() and should be capable of holding ten double-precision numbers. The numbers that should be stored by the user in current are 10.62, 1.89, 13.21, 16.55, 18.62, 9.47, 6.58, 18.32, 12.15, 3.98. The number that should be stored by the user in resistance are 4, 8.5 6, 7.35, 9, 15.3, 3, 5.4 2.9 4.8. Your program should pass these three arrays to a function named calc_volts(), which should calculate the elements in the volts array as the product of the corresponding elements in the current and resistance arrays (for example, volts[1] = current[1] * resistance[1]). After calc_volts[ ] has put values into the volts array, the values in the array should be displayed from within main( ).
Create a C++ program that declares three single-dimensional arrays named volts, current, and resistance. Each array should be declared in main() and should be capable of holding ten double-precision numbers. The numbers that should be stored by the user in current are 10.62, 1.89, 13.21, 16.55, 18.62, 9.47, 6.58, 18.32, 12.15, 3.98. The number that should be stored by the user in resistance are 4, 8.5 6, 7.35, 9, 15.3, 3, 5.4 2.9 4.8. Your program should pass these three arrays to a function named calc_volts(), which should calculate the elements in the volts array as the product of the corresponding elements in the current and resistance arrays (for example, volts[1] = current[1] * resistance[1]). After calc_volts[ ] has put values into the volts array, the values in the array should be displayed from within main( ).
Step by step
Solved in 3 steps with 1 images