Additions to Phase 1
Transactions
Each account stores transactions information (the type of transaction (e.g. withdrawal, deposit …etc), the amount, the time of transaction and any additional information you think is important). When any transaction occurs this transaction is recorded in the account. So each account has more than one transaction. You should enable printing a report of a transactions performed on an account.

Standing orders
In addition each account contains a number of standing orders .Standing orders store the following information (the day of the month which it is paid, the regular amount to be paid and to whom the SO is payable). You should enable adding, deleting and processing a standing order. Processing an SO means checking if the day of the month is today, if it is, then withdraws the amount from the account and recording this as a transaction. You should enable processing standing orders for all accounts.

Account Types
Extend account so that there will be two types of accounts
o Personal account
o When the account is overdrawn there is a charge of $10 .
o Company account
o On each withdrawal, or deposit there is a charge of 5 cent.

phase 1

Implement a system for a bank. Design it so it can be used by the bank’s staff. It should enable the following:
o Opening a new account for a customer
o Closing an account
o Displaying all accounts

An Account
o Contains the name of the customer
o Contains the account balance.
o Enables withdrawal from the account
o Enables depositing to the account
the solve of phase1

/*THIS CODE IS  A CODE FOR BANK SYSTEM WICH ALLOW THE COSTEMER TO OPEN A NEW ACCOUNT , CLOSE ACCOUNT , DEPOSIT,
WITHDRAW ,  SHOW ACCOUNT INFORMATION*/

#include  <iostream>
#include  <conio.h>
#include <stdlib.h>
using namespace std;
using std::fixed;

class Customer {//BEGIN OF THE CLASS

   private:
      char name[20];
      char address[30];
      char city[20];
      char pcode[6];
      double acc_bal;
double zak;
   public:
      Customer:: Customer() {              // CONSTRUCTOR
         acc_bal = 0.00;
      }
      
      void getdata();
	  void close_account();
      void deposit(); 
      void withdraw();
      void showdata();
	  

};//END OF CLASS
 /////////OPEN ACCOUNT////////////
void  Customer:: getdata() {
         cout << "\nEnter your name: ";    cin >> name;
         cout << "\nEnter your address: ";   cin >> address;
         cout << "\nEnter your city: ";      cin >> city;
         cout << "\nEnter your postal code: ";    cin >> pcode;
         cout << "\nEnter current account balance: ";    cin >> acc_bal;
      }
	  ////////CLOSE ACCOUNT///////////
void  Customer::close_account()
	  {
		  int i;
		  i=0;
		  name[i]='\0';
		  address[i]='\0';
          city[i]='\0';
          pcode[i]='\0';
		  acc_bal=0.00;
		  cout<<"Thanks for using our bank"<<endl;
	  }
/////////DEPOSIT////////////
void  Customer::deposit() {
         float dep;
         cout << "\nEnter amount to be deposited: ";
         cin >> dep;
         acc_bal += dep;
      }
/////////WITHDRAW////////////
void  Customer::withdraw() {
         float wdraw;
         cout << "\nEnter amount to be withdrawn: ";    cin >> wdraw;
         acc_bal -= wdraw;
      }

	  /////////DISPLAY ACCOUNT////////////
void  Customer::showdata()
	  {
		  
         cout << "Name: " << name;
         cout << "\nAddress: " << address;
         cout << "\nCity: " << city;
         cout << "\nPostal Code: " << pcode;
         cout << "\nAccount Balance: " << acc_bal<<"S.R."<< endl;
      }


//////////////////MAIN///////////////
int main() {

   char choice;
   bool flag =0;
   int count = 0;
   int recnum;
   Customer cust[10];
   
//////////////////MENU///////////////
   while (flag == false) {
      cout << "\t\t\n\n" << "Main Menu";
      cout << "\t\n\n" << "Select by letter:";
      cout << "\t\n" << "o - open new account.";
      cout << "\t\n" << "d - Deposit money.";
      cout << "\t\n" << "w - Withdraw money.";
      cout << "\t\n" << "s - Show Account Information.";
      cout << "\t\n" << "c _ close account.";
      cout << "\t\n" << "q - Quit Application.\n\n";
      cout << "\t" << "Choice: ";
      cin>>choice ;
	  // END OF THE MENU
	  cout<<fixed;
      switch(choice) {
         case 'o':
            system("cls");
            if (count > 10) {
               cout << "Can't add anymore records. Press any key to return to main menu.";
               getche();
               break;
            }
            count += 1;
            cust[count].getdata();
            system("cls");
            break;

         case 'd':
            system("cls");
            cout << "\nEnter customer number: ";
            cin >> recnum;
            cust[recnum].deposit();
            system("cls");
            break;

         case 'w':
            system("cls");
            cout << "\nEnter customer number: ";
            cin >> recnum;
            cust[recnum].withdraw();
            system("cls");
            break;

         case 'z':
            system("cls");
            cout << "\nEnter customer number: ";
            cin >> recnum;
            cust[recnum].zakat();
			getche();
            system("cls");
            break;
         case 's':
            system("cls");
            cout << "\nEnter customer number: ";
            cin >> recnum;
            cust[recnum].showdata();
            getche();
            system("cls");
            break;
		 case 'n':
                  system("cls");
            cout << "\nEnter customer number: ";
            cin >> recnum;
            cust[recnum].zakat_account();
			 getche();
            system("cls");
            break;
           case 'c':
            system("cls");
            cout << "\nEnter customer number: ";
            cin >> recnum;
            cust[recnum].close_account();
			getche();
            system("cls");
            break;

         case 'q':
            flag = 1;
            break;

         default:
            cout << "\nInvalid selection. Press a key to return to main menu.";
            getche();
      }

      if (flag == true) {
         break;
      }

   }
   
   return 0;
}

// END MAIN

Recommended Answers

All 9 Replies

And the question is?

If I were to approach this project I'd use an outline somthing like this:

A) Bank
   I) Container of Accounts
  II) Add Account
 III) Delete Account
 IV) Display single Account
  V) Display all Accounts
 VI) Process Standing Orders in Accounts

B) Accounts
     I) Type
         a) Personal
         b) Business
    II) Demographics
         a) Name
         b) ID number
         c) Address
   III) Balance
   IV) Transaction
         a) Type of Transaction
             i) Add to Balance
            ii) Withdraw from Balance
         b) Date of Transaction
    V) Container of Standing Orders
         a) Date of Activity
         b) Amount of Transaction
         c) Type of Transaction
   VI) Container of Transactions
  VII) Display current Transactions
 VIII) Display all Transactions

And the question is?

QUOTE]

how can I do phase 2 I do not know the way :sad: if you can help ;)

That is not a question (and what is phase two, only saw phase 1)...
Be specific and stop asking peps to solve your homeworks for youself.

Additions to Phase 1
Transactions
Each account stores transactions information (the type of transaction (e.g. withdrawal, deposit …etc), the amount, the time of transaction and any additional information you think is important). When any transaction occurs this transaction is recorded in the account. So each account has more than one transaction. You should enable printing a report of a transactions performed on an account.

Standing orders
In addition each account contains a number of standing orders .Standing orders store the following information (the day of the month which it is paid, the regular amount to be paid and to whom the SO is payable). You should enable adding, deleting and processing a standing order. Processing an SO means checking if the day of the month is today, if it is, then withdraws the amount from the account and recording this as a transaction. You should enable processing standing orders for all accounts.

Account Types
Extend account so that there will be two types of accounts
o Personal account
o When the account is overdrawn there is a charge of $10 .
o Company account
o On each withdrawal, or deposit there is a charge of 5 cent.

thi is phase 2
phase 1 i am the one who do it with some help

Ok, I got to learn how to read but that is still not a question imo... (se I can admit when I make a mistake)

as you wish it is a wrong way to write aquistion
but please i need the help speisally at the time
i know that there is time function but i do not know the right way to use it
thanks

Asking how to implement phase 2 is still a very broad question. I'd probably declare classes to represent a Bank, an Account, a Transaction, a Customer, a Standing Order, and a Date. I'd probably use an STL vector to hold all the Accounts in a Bank, all the Transactions in an Account, and all the Standing Orders in an Account. If you don't know about or can'tuse STL containers then I'd probably use lists instead of vectors , or if that's not possible, then I'd use arrays instead of vectors.

Then within the Date class I'd have member values including day, month, year, and I'd overload the == operator to compare just the day members so I could easily compare days when trying to run the Standing Orders.

You've already worked up a pretty good Customer Class.

The Transaction class would include a member to indicate the amount of the Transaction, whether the Transaction increased or decreased the balance in an Account, whether the Transaction was a Standing Order or not, whether the Transaction was result of an overdraft or the result of a Transaction Fee, and the Date of the Transaction. I would overload the << to display the transaction information.

An Account would have a Customer member, a balance, a member to indicate the type of Account, a vector of Transactions, a vector of Standing Orders, etc.

A Bank would have a vector of Accounts. It would have methods to add/delete/display Accounts, and to process Standing Orders based on date.

As to how to proceed. I'd probably try writing a Date class first and make sure I could get that working. Then I'd work on the Transaction class, followed by the Account class and then the Bank class. As I'm working on each class I'd ask specific questions about the structure of a class, how to implement a given method, etc., and I'd post relevant code, error messages, etc., if I sought assistance on a board such as this.

But the broad outline is really up to you. I will say, you're likely to get better answers by asking better questions, which are usually specific in their content and include specific examples from your code, error messages, etc.

I applaud your patience, sir... (Gives some reputation)

thanks for your advance lerner
thanks perniciosus

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.