Question: c program. Write a banking application where a user will enter their current balance and a transaction. The user will enter the amount to withdraw

c program. Write a banking application where a user will enter their current balance and a transaction. The user will enter the amount to withdraw or deposit and the application will calculate their new balance. A deposit will be represented by a positive number and a withdrawal will be represented by a negative number, so do not ask them what kind of transaction they want! If the transaction causes them to be overdrawn charge a 25.00 overdraft fee. Output the following: previous Balance, amount deposited or withdrawn, the overdraft fee if applicable, and the new balance. Do not miss any of these outputs! When outputting the transaction type, include the type (withdraw or deposit) and amount. No SADITM is necessary!
Example input (Make your input look EXACTLY like this):
Please enter your current balance and the amount of your transaction, separated by a space: 100.50-50.20
Example output (Make your output look EXACTLY like this):
Your previous balance was $100.50
You performed a withdraw of $-50.20
Your new balance is $50.30
Note that this example does not cover all cases!!!
Most common problems (This is NOT an exhaustive list):
Correct assignment number is Program04:Bank Application.
Incomplete purpose line. Tell me more about the program.
NEVER print out doubles with %lf. I've been saying this since the very first assignment! Use %f instead.
Print out the overdraft amount using the constant macro instead of printing out 25.00.
overdraft fee should be set up as a constant macro since it should never change. overdraft fee is also required to be used in the output and in the calculations.
Most of your output is identical between your three cases such as previous balance and new balance output. Put these lines before the if or after the if to prevent code duplication and potential error duplication as well.
Output should use the constant macro instead of using $25 directly. This will automatically adjust if the overdraft fee is changed later.
Overdraft fee needs to state the overdraft fee in the output if it is applied as per the instructions.
Incorrect output for the case when withdrawing all the money in the account. There should no be overdraft fee.
Incorrect output for the case of negative balance with positive transaction. This is a deposit. It should never result in an overdraft.
Include some additional comments to help a reader walk through the code.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!