Skip to content

Instantly share code, notes, and snippets.

@mahimrocky
Last active December 12, 2018 18:22
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mahimrocky/a7f88fbe86649536260c6d0f2035e70d to your computer and use it in GitHub Desktop.
Save mahimrocky/a7f88fbe86649536260c6d0f2035e70d to your computer and use it in GitHub Desktop.
class account{
int totalBalance = 0;
// then call data from DB
// show all data
int row = totalrow;
if(row>0){
//take last row
totalBalance = lastrowBalance;
}
// now user can insert new credit or debit
if(isCredit){
totalBalance += (+creditValue);
}else{
totalBalance += (-debitValue);
}
insert-> credit,debit,balance;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment