I've made a program of basic bank transaction. I'm having a hard time figuring out how will that cin >> newb; and cin >> currentb; work out...the program works if you remove the formulas..also i'd like to add if (withdraw <=10000) the program will stop the user from withdrawing but i don't know how will i insert it in there since i've been receiving too much errors if i do so...
and, if you don't mind, how will i post my code so you guys can check my crap program..lol~..
For starters, when dealing with money, a transaction is almost never an even-dollar amount (or whatever unit of currency you use). You should deal exclusively in floating-point data types (i.e. "float" or "double") and avoid integer data types.
Second, your equation for calculating a withdrawal (Line 25) actually gives the user a $2.50 bonus/credit to their account, rather than charging a $2.50 fee. Your equation should be more like this: [tex]newb = currentb - (withdraw + 2.50)[/tex]
Correct those issues, then use the tips to see if you can correct your other issues.