I was wondering if I could get some help on the last program I need to…

I was wondering if I could get some help on the last program I
need to complete for an engineering C++ class. It is a very simple
program however there is one part of the problem stumping me. Here
is the problem statement
. Write a C++ program that reads in from a file two month names,
followed by the rainfall amounts for each month in that span of
months. These rain amounts are totaled, and then an average for
each month in the span of months is calculated. Because the program
does not know how many months of rainfall data there is, it must
read and process data values until the end of file is encountered.
The data for this program can be found in the Rainfall.txt file,
which is located in on Blackboard
Below is the file data. As you can see it is extremely simple
however I cannot for the life of me figure out how to make the
program distinguish between strings and numeric data to sort into
respective arrays. I have tried 2d arrays, Two 1D arrays, the peek
function, getline functions and a multitude of other
approaches.
April
August
1.16 2.02 1.34 1.51 .30