I'm looking for a way of getting to automatically make some calculations. The set of input variables is:
- constant in their number (5)
- in a txt file
- has the following format (whitespace is SPACE but can be TAB):
1 2
|
double double int int int
//ad infinitum, each in a new line
|
I have tried doing research, but most cases relate to single line. In my case the number of lines will be => 1. I think the problem description is like this:
- open file //left open untill end of data (check by cin.fail, i think)
- get line_1 (string, but not sure how to move each parameter from file into the program (into vector?))//with added function to skip a line if it is not in proper format
- do calculations_1 (there are diffrent equations using diffrent variables, so i'm thinking that maybe filling a vector with said variables is best and then simply construct equations that use vector_name[variable_name]
- save results and input into a file (or just the results), each line starting with date and time
- results must have a precise date/time
- clear vector (no clue how to do it)
- get line_2
- repeat untill end of lines
- integrate into main program
- make it graphic XD
I'd like someone to weigh in on if this approach is reasonable or perhaps to point me towards a tutorial with stuff like that. 13.6 on LearnCpp.com is great and all but i think my problem is too specific and/or convoluted or plain badly thought out.