Write a program that declares three one-dimensional arrays named current, resistance, and voltage. Each should be declared in main() and be capable of holding 10 double-precision numbers. The numbers to be stored in current are 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 resistance are 4, 8.5, 6.0, 7.35, 9.0, 15.3, 3.0, 5.4, 2.9, and 4.8. Have your program pass these three arrays to a function called calcvolts(), which calculates the elements in the voltage array as the product of the equivalent elements in the current and resistance array: for example,   Voltage[1] = current[1] * resistance[1]   After calcvolts() has put values in the voltage array, display the values in the array from within main(). Write the calcvolts() function by using

C++ for Engineers and Scientists
4th Edition
ISBN:9781133187844
Author:Bronson, Gary J.
Publisher:Bronson, Gary J.
Chapter10: Pointers
Section: Chapter Questions
Problem 5PP
icon
Related questions
Question

Write a program that declares three one-dimensional arrays named current, resistance, and voltage. Each should be declared in main() and be capable of holding 10 double-precision numbers. The numbers to be stored in current are 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 resistance are 4, 8.5, 6.0, 7.35, 9.0, 15.3, 3.0, 5.4, 2.9, and 4.8. Have your program pass these three arrays to a function called calcvolts(), which calculates the elements in the voltage array as the product of the equivalent elements in the current and resistance array: for example,

 

Voltage[1] = current[1] * resistance[1]

 

  • After calcvolts() has put values in the voltage array, display the values in the array from within main(). Write the calcvolts() function by using
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 4 steps with 2 images

Blurred answer
Knowledge Booster
Array
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
C++ for Engineers and Scientists
C++ for Engineers and Scientists
Computer Science
ISBN:
9781133187844
Author:
Bronson, Gary J.
Publisher:
Course Technology Ptr
Programming Logic & Design Comprehensive
Programming Logic & Design Comprehensive
Computer Science
ISBN:
9781337669405
Author:
FARRELL
Publisher:
Cengage