Answers
#include <iostream>
#include <iomanip>
using namespace std;
int main()
{
const int max_num = 10;
int k;
double current[max_num], resistance[max_num], calc_volts[max_num];
for (k = 0; k < max_num; k++ )
{
cout << "Please Enter the ten values given for resistance:";
cout << "10.62, 14.89, 13.21, 16.55,\n\n 18.62, 9.47, 6.58, 18.32,";
cout << " 12.15, 3.98 or any ten values of your choice\n :";
cin >> current[k];
cout << "Now enter ten values for the resistance:\n";
cout << "4, 8.5, 6, 7.35, 9, 15.3, 3, 5.4, 2.9, 4.8.\n";
cout << " or any ten values of your choice.\n\n";
cin >> resistance[k];
}
for (k = 0; k < max_num; k++ )
{
calc_volts[k] = current[k] * resistance[k];
}
cout << "\nCurrent Resistance Volts" << endl;
for (k = 0; k< max_num; k++ )
{
cout << setw(7) << current[k] << setw(11) << resistance[k]
<< setw(11) << calc_volts[k] << endl;
}
}
]