Bank Account Program

  • Hello Guest! Welcome to ConsoleCrunch, to help support our site check out the premium upgrades HERE! to get exclusive access to our hidden content.
  • Unable to load portions of the website...
    If you use an ad blocker addon, you should disable it because it interferes with several elements of the site and blocks more than just adverts.
  • Read Rules Before Posting Post Virus Scans with every program.

Psycho_Coder

Active Poster
Retired Staff
Active Member
Apr 12, 2014
642
481
133
UK
I created a simple bank account program before. Nothing much, Take it edit it, But leave credit for me. :P

Here is the accounts.h file.
Code:
class cust_acc
{
      private:
              float bal;
              int acc_num;
      public:  
          void setup();
          void lodge(flost);
          void withdraw(float);
          void balance();
         
          }
Here is the accfuns file.
Code:
/*
*This was created By RealTimeModding
* program file 'accfunc.cpp'
* define 'cust_acc' member functions
*/

#include <iostream>
using namespace std;

#include 'accounts.h'

//
//custom_account member functions
//
void cust_acc::setup()
{
cout << "enter number of account to be opened: ";
cin >> acc_num;
cout << "enter initial balance: ";
cin >> bal;
cout << "customer account" << acc_num
                << "created with balance" << bal << endl;
                }
                void cust_acc::lodge(float lodgement}
                {
                     bal += lodgement;
                     cout << "lodgement of " << lodgement << "accepted " << endl;
                     }
                void cust_acc::withdraw(float with)
                {
                     if(bal > with)
                     {
                            bal = with;
                            cout << "withdrawal of" << with
                                  << "granted" << endl;
                                  return;
                                  }
                            cout << "insufficent balance for withdrawal of"<< with << endl;
                            cout << "withdrawal of" << bal << "granted" << endl;
                            bal     = (float)0;
                            }
                     void_cus_acc:balance()
                     {
                        cout << "balance of account is" << bal << endl;
                       
                                           }

Here is the accounts file.

Code:
/*
*This was created by ReaaTimeModding
* program file 'accounts.cpp'
*drievs the 'cust_acc' class
*/

#include <iostream>
using namespace std;

#include "accounts.h"

int main()
{
    cust_acc a1;
    a1.setup();
    a1.lodge(250.00);
    a1.balance();
    a1.withdraw(500.00);
    a1.balance();
}
 
  • Like
Reactions: TheMystery
Is it a good thing that I can still understand coding? Lol xD Its been like 1-2 years since I messed with code haha.
 
  • Like
Reactions: Psycho_Coder
General chit-chat
Help Users
  • No one is chatting at the moment.
  • Chat Bot:
    irritabletwig42 is our newest member. Welcome!
  • Chat Bot:
    rodrigoo70 is our newest member. Welcome!
  • Chat Bot:
    s8trangchu is our newest member. Welcome!
  • Chat Bot:
    LoveModz has joined the room.
  • Chat Bot:
    e39center is our newest member. Welcome!
  • Chat Bot:
    ANGUS0023233 has joined the room.
  • Chat Bot:
    ANGUS0023233 has joined the room.
  • Chat Bot:
    QM|T has joined the room.
  • Chat Bot:
    UnNwarFDP is our newest member. Welcome!
  • Chat Bot:
    mu88spott is our newest member. Welcome!
  • Chat Bot:
    mu88ppcom is our newest member. Welcome!
  • Chat Bot:
    RAY5 is our newest member. Welcome!
  • Chat Bot:
  • Chat Bot:
    euo00ou01 is our newest member. Welcome!
  • Chat Bot:
    ANGUS0023233 has joined the room.
  • Chat Bot:
    v79vnpro1 is our newest member. Welcome!
  • Chat Bot:
    e39fcom is our newest member. Welcome!
  • Chat Bot:
    QM|T has joined the room.
  • Chat Bot:
    8xbet00co3 is our newest member. Welcome!
  • Chat Bot:
    e39agency2 is our newest member. Welcome!
  • Chat Bot:
    v79netpll is our newest member. Welcome!
  • Chat Bot:
    van888me is our newest member. Welcome!
  • Chat Bot:
    v79bio is our newest member. Welcome!
  • Chat Bot:
    QM|T has joined the room.
  • Chat Bot:
    uu8886net1 is our newest member. Welcome!
      Chat Bot: uu8886net1 is our newest member. Welcome!