Need little help using a arrays. I need 2 parallel arrays with 5elements, one wi
ID: 3609398 • Letter: N
Question
Need little help using a arrays. I need 2 parallel arrays with 5elements, one with strings and the other integers that I will getfrom the user. For the 2nd array I need a loop that runs throughand asks user for input.The code I have:
const int X1 = 2;
const int X2 = 5;
int main()
{
string first[X1][X2]={{"n1"},{"n2'},{"n3"},{"n4"},{"n5"};
char name1;
int num1=0;
for(int index=0; index<=X1; index++)
{
cout << "Enter" << first[X1][0] << "number";
cin >> table[index][1];
This is all I have(which is not correct), what I am trying to do ismake a loop that runs through each n1,n2,n3, etc. and(trying tomake the loop run through each) and ask the user to input a numberfor each name and then store that number and display it along withwhich name is goes with so display, also display the total that theuser inputed, and which name had the lowest numer, ex:
n1: 5
n2: 4
etc.
and then a total of the numbers, and which one had the lowestnumber. Thanks
*Edit- I believe i need to use a Nested Loop, a loop inside a loop.Need a little help.
Explanation / Answer
please rate - thanks #include using namespace std; int main() { string name[5]; int grade[5],i,sum=0,low=10000,lowindex; for(i=0;iRelated 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.