PROBLEM 1: Copy a file to another file (create thefuntion: void writeFile (strin
ID: 3610499 • Letter: P
Question
PROBLEM 1:
Copy a file to another file (create thefuntion: void writeFile (string outStr, string filename) to doit)
Source file(input.tx) Outputfile (output.tx)
This is anapple ----> str[0] ----> This is an apple
This is abook ----> str[1] ----> This is a book
This is a cat ----> str[2] ----> This is a cat
PROBLEM 2:
Count how many times each word shows ina file (input.txt)
The content of the file looks like this:
i love you.
no, it is not true.
i really love you.
no, you are not serious =.= , i don't believe in you.
The result should be like this:
i 3
love 2
you. 3
no, 2
it 1
is 1
not 2
true. 1
really 1
you 1
are 1
serious 1
=.= 1
, 1
don't 1
believe 1
in 1