reset password
Author Message
dtang9
Posts: 52
Posted 18:55 Nov 05, 2017 |

For HW10P04,  it says display the results in an output file. Do we use Print Writer to display the output onto the same file the user entered? Or do we create another separate output file?

Last edited by dtang9 at 18:55 Nov 05, 2017.
kknaur
Posts: 540
Posted 18:57 Nov 05, 2017 |
dtang9 wrote:

For HW10P04,  it says display the results in an output file. Do we use Print Writer to display the output onto the same file the user entered? Or do we create another separate output file?

You should write to a new file.  Generally speaking, you don't want to write back to the input file unless you are doing something specialized.  If you write to the input file you will most likely overwrite the input data which is not good.

dtang9
Posts: 52
Posted 19:18 Nov 05, 2017 |

With writing to a new file in mind, do we prompt the user to also enter the name of the output file?

kknaur
Posts: 540
Posted 19:39 Nov 05, 2017 |

You may do that if you wish, or you may choose a name internally and just always write to that file.