Write a program that specifies three one dimesional arraysnamed current , resist
ID: 3609223 • Letter: W
Question
Write a program that specifies three one dimesional arraysnamed current, resistance, and volts.Each array should be capableof holding 10 elements. Using a forloop, input values for the current andresistance arrays. The entries in the volt arraysshould be the product of the corresponding values in thecurrent and resistance arrays (thus,volts[ i ] = current [ i ]*resistance [i ] ). After all of the data has been entered, display thefollowing out put Current Resistance Volts Under each column heading display the appropriate value. Write a program that specifies three one dimesional arraysnamed current, resistance, and volts.Each array should be capableof holding 10 elements. Using a forloop, input values for the current andresistance arrays. The entries in the volt arraysshould be the product of the corresponding values in thecurrent and resistance arrays (thus,volts[ i ] = current [ i ]*resistance [i ] ). After all of the data has been entered, display thefollowing out put Current Resistance Volts Under each column heading display the appropriate value.Explanation / Answer
please rate - thanks #include<iostream.h>int main()
{int current[10],resistance[10],volts[10],i;
for(i=0;i<10;i++)
{cout<<"Enter current # "<<i+1<<":";
cin>>current[i];
cout<<"Enter resistance # "<<i+1<<":";
cin>>resistance[i];
volts[i]=current[i]*resistance[i];
}
cout<<"Current Resistance Volts ";
for(i=0;i<10;i++)
cout<<" "<<current[i]<<" "<<resistance[i]<<" "<<volts[i]<<endl;
system("pause");
return 0;
}
Related Questions
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.