program that specifies three one dimensional arrays named current, resistance, and volts. each array should be declared in main() and should be capable of holding 5 double precision numbers. the numbers should be stored in current are {10.62, 7.23, 15.12, 20.15, 9.62} resistance{8.51, 6.58, 7.35, 15.12, 2.05}, calcVolts () . which shoul calculate the elements in the volts array by getting the product of the corresponding elements of current and resistance arrays. then the values of the volts should be displayed within the main()
You've just got to create the three one-dimensional arrays, call calcVolts with the provided arguments, and use a for loop to output each element inside of volts[].
I wasn't trying to be disrespectful, there have indeed been people who have jokingly given intentionally bad solutions and it is difficult to determine emotion or genuine-ness on the internet.
The OP's specifications are vague but say to use doubles. I don't think templates are appropriate here anyway unless you forced them to only allow floating point types.
i'm a newbie. we were asked to solved this as a home work and it's so hard because we haven't discussed it yet. so if you could help me, i will do my best to figure out why it came out with that kind of solution . :)) :(