Program is to calculate the account balance at the end of the month
#include<iostream>
#include<conio.h>
using namespace std;
int main()
{
double account_balance = 0.00, federal_tax = 0.00;
int amount_deposited = 0, amount_withdrawed = 0;
cout
<< "\n\n\t\t __ Account Balance Problem __";
cout
<< "\n\n
Enter the Account Balance -
";
cin
>> account_balance;
cout
<< "\n\n
Enter the Amount Deposited -
";
cin
>> amount_deposited;
cout
<< "\n\n
Enter the Amount Withdrawed -
";
cin
>> amount_withdrawed;
federal_tax
= 0.01 * (amount_deposited + amount_withdrawed);
account_balance
= (((account_balance - amount_withdrawed) + amount_deposited) - federal_tax);
cout
<< "\n\n\t __ Account Balance at the end
of the month - " << account_balance << " ___";
getch();
return 0;
}
Program reads in one customer’s account balance at the
beginning of the month, a total of all withdrawals for the month, and a total
of all deposits made during the month. A federal tax charge of 1% is applied to
all transactions made during the month and calculates the account
balance at the end of the month by
- subtracting the total withdrawals from the account balance at the beginning of the month.
- adding the total deposits to this new balance.
- Calculating the federal tax (1% of total transactions, i.e. total withdrawals + total deposits) and
- Subtracting this federal tax from the new balance.
No comments:
Post a Comment