So i'm writing a program to calculate the total rainfall. The problem i have is when I am outputting the month and rainfall to the screen. What is happening is that it prints out the name of the month and all the rainfalls( so january has 12 different rainfalls when it should only be one.)PS i dont really know how to use code tags here) but this is what I have to infile the months and rainfall
for (int i = 0; i < 12; i++)
{
inFile >> name[i];
}
for (int j = 0; j < 12; j++)
{
inFile >> rain[j];
}
and this is the for loop I have that I know is wrong
for (int i = 0; i < 12; i++)
for (int j = 0; j < 12; j++)