1) Read an integer # from the file balance.dat that represents the balance on your checkbook (Assume integer #'s only)
2)let the user enter an amount to write a check.
3)If there is enough balance to write teh check then display the message (OK to write check) if the check is overdraft 350.00, from 1-50 dollars then the bank charges 5 dollars more to cash the check so display message (OK to write check , but 5 dollars will be charged due to NSF)
4) remember to chekc if the file exists before you do anything (usethe .fail() function)
Intro2Prog
0
Newbie Poster
Recommended Answers
Jump to PostOkay, what part are you having trouble with? Keep in mind that if you say you haven't done anything yet, I'll tell you to get lost. If you have done something, you'll need to prove it. Why? Because this is obviously homework, it's obviously easy if you put in a …
Jump to PostVery close, but inBalance is a stream, not an integer. After you open the file, do something like this:
int balance; inBalance>> balance;
Then use balance and checkAmount for your conditional statements.
All 7 Replies
Narue
5,707
Bad Cop
Team Colleague
Intro2Prog
0
Newbie Poster
Intro2Prog
0
Newbie Poster
Narue
5,707
Bad Cop
Team Colleague
Intro2Prog
0
Newbie Poster
jasweb2002
0
Junior Poster in Training
Narue
5,707
Bad Cop
Team Colleague
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.