the code hasn't really changed from the one above. right now i am playing around with pointers trying to get the balance to stay changed when i add to it or subtract from it
Code:int main(){
int count_credit=0, count_debit=0;
char option;
float balance = 2000;
float deposit, total_one, total_d;
float withdraw, total_w, total_two;
float min_bal;
printf("Your balance is: %.2f\n\n", balance);
printf("Transaction options: \n");
printf("1 - Deposit funds (credit transaction) \n");
printf("2 - Withdraw funds (debit transaction) \n");
printf("3 - Print statement of account \n");
printf("4 - Compute interest and exit \n");
while(option!=4){
printf("Please indicate your option:\t");
scanf("%d", &option);
if(option==1){
printf("\n How much do you want to deposit?\t");
scanf("%f", &deposit);
total_d+=deposit;
total_one= (total_d + balance);
printf("Your balance is:\t %.2f\n", total_one);
//end of option one
count_credit++; // counts credit transactions
}
else if (option==2){
printf("\n How much do you want to withdraw?\t");
scanf("%f",&withdraw);
total_w=(total_w-withdraw);
balance=total_one;
total_two=(balance+total_w);
printf("Your current balance is:\t %.2f\n", total_two);
count_debit++; //counts debit transactions
}//end of option two
else if (option==3){
printf("\n Current balance:\t%.2f\n", balance);
min_bal=(balance*1.28);
printf("Minimum balance: \t%.2f\n", min_bal);
}//end of option three
}//end of while statement
//option 4
printf("\nStatement of Account:\n\n");
printf("Credit Transactions: %d\n", count_credit);
printf("Debit Transactions: %d\n", count_debit);
printf("Current Balance: \n");
printf("Minimum Balance: \n");
printf("Interest Computed: \n");
printf("Final Balance: \n");
printf("\nGood Bye! \n");
system ("pause");
return 0;
}

