Need Help!

Sep 21, 2012 at 7:30pm
Hi guys im having trouble figuring out how to complete this assignment

Use Notepad to create an input file with the following input data for this program: .01 36 10000 (which is the monthly interest rate, number of payments, and the amount of the loan).
Send all output (formatted as shown in your text) to an output file. Format the output using the appropriate manipulators and/or member functions.

any help would be nice.
Sep 21, 2012 at 7:40pm
Well, you'll need <fstream> and <iomanip> at the very least according to your requirements. What have you accomplished?
Sep 21, 2012 at 7:42pm
Have you done anything yet, or are you hoping someone will write it for you? Please post any code you've written so far.
Sep 22, 2012 at 12:20am
I have no idea what im doing so no i have not written anything yet.
Sep 22, 2012 at 3:20pm
Well, stop looking at the problem as a whole. Break it up into manageable tasks.

Step 1) You need to create an input file. This is as hard as opening a text editor and putting in the information given

Step 2) You need to write a small program that can read information from a file and store it temporarily. This is where the <fstream> header comes in.
http://www.cplusplus.com/reference/iostream/fstream/

Step 3) You now need to output this information that you stored, to a second file. Once again, you'll use <fstream> for this.

Note: You can use one fstream object for both writing and reading from a file, but if you have no experience with it I would recommend using an ifstream (input file) object for the reading, and an ofstream (output file) object for writing to the file.

This should be enough information to get you started.
Topic archived. No new replies allowed.