176k views
5 votes
part b the next few lines open and then read a data file. data is read in 1 line at a time using a while loop that continues until the end of file (eof) is detected. when each line of data is read, the time/date stamp is temporarily stored in a string variable names s1 and the temperature in a float variable named f1. build the vectors datetime and temp by adding (appending) these values (s1 and f1) to the correct vector variables (declared in part a) using the push back() function of the vector class.

User Seddonym
by
8.5k points

1 Answer

3 votes

Answer:

This can be done by creating a while loop which reads each line of the data file until the end of file (EOF) is detected. Each line of data should be read into a string variable called s1 and a float variable called f1. Then, these values can be added to the vectors declared in Part A by using the push_back() function of the vector class. This will add the time/date stamp stored in s1 and the temperature stored in f1 to the correct vector variables.

User MadTech
by
6.7k points