I Need help refreshing my memory on file reading and writing.
Here is our given task, we have to write down the code on paper.
this is a file that I would have to open, read and use
1
2
3
4
5
6
Jane
Doe
is
married
to
Bob
Macky
.
They
live
on
a
mountain
.
yes the periods are included.
We have to read in all of the numbers and process them mathematically like addition, subtraction, multiplication, division.
We have to make two sentences plus our own.
Then we have to write our data back into a file
Our teacher said that we may "hard code" the files what does that mean?
He also gave us this
data_In.txt
data_Out.txt
Oh! That's just the file names that we'd theoretically use within the debug folder.
He said we don't need to use an if statement, just file reading and loops.
So...
My plan of action
I want to treat the lines just as individual lines
as in
int line01
string line07 etc...
But can I just add the lines?
I'm trying to figure out how you would combine lines to make coherent sentences...
I suppose I could just set it up as an array and use indexes, but I still don't know how to use individual lines.
Any body have any tips? I've got this final in about 8 hours
Thanks for any help in advance.