Bank Account Project!!(assistance)

I am doing a project That 1) Has a Class called BankType
2)Has Class functions(implementation file)
3)Has void function to update balance of the account (Make it ask for account password/ error trap for incorrect PW)
4)Able to View the account balance (ask for PW again)
5)Has a menu that asks user for action
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
// Implementation File (banktype.cpp)
// This file implements the BankType member functions;

#include<BankType.h>
#include<string>
#include<iostream>
#include<bool.h> 

using namespace std;




int main()
{
    
    int sentinal, magic;
    sentinal=999
    
    BankType bankObject;
    bankObject.BalanceUpdate();
    bankObject.DisplayBalance();
                
    
    
    cout<<"\nThank You for Choosing Barter Bank!\n"<<endl;
    
    //loop (while loop with sentinel=99)
    while (magic != sentinal)
    {
    cout<<"Please Enter Your Choice of Account Options: "<<endl;
    cout<<"Enter-1)  Process a Deposit or Withdrawl"<<endl;
    cout<<"Enter-2)  View Your Account Balance"<<endl;
    cout<<"Enter-99)  To EXIT: "<<endl;
    cin>>magic; //reads magic and determines what void to run.
    }
    
    cout<<"Exiting..."<<endl;
    
    
    
  
    
  
    
    
    
     system("pause");
    return 0; 
    
}


1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
[

#include<iostream>

using namespace std;

    //Initialization Constructor
    class BankType
{
        public:
             void BankType();
             void BalanceUpdate();
             void DisplayBalance();
                

        private:
             char firstName[15];
             char lastName[15]; 
             int password; 
             double acctBalance;
                
      BankType::BankType(char firstName[], char lastName[], int password, double acctBalance)//constructor prototype


};

BankType::BankType(char firstName[], char lastName[], int password, double acctBalance){
    //Default Constructor
   firstName = "Ineeda";
   lastName = "Aye";
   password = "1234";
   acctBalance = 0;
}

void BankType::BalanceUpdate() {
     char update;
     int PW, depot, withd;
    //Make sure to password protect!!!
     // for(i=0;i<3;i++)
      
      cout<<"Please Enter Accounnt Password: "<<endl;
      cin>>PW;
      
      if(PW==1234)
      {
                  cout<<"Enter 1-)  Deposit"<<endl;
                  cout<<"Enter 2-)  Withdrawl"<<endl;
                  cin>>update;
                  
      if(update==1){ 
         cout<<"Enter amount you would like to Deposit: "<<endl;
         cin>>depot;
         ba+=depot;           }
      
      else if(update==2){
         cout<<"Enter amount you would like to Withdraw: "<<endl;     
         cin>>withd;
         ba-=withd   }
         
      else{
         cout<<"You Have Entered a Incorrect Selection"<<endl;
           
           
           } 
                    
     }
                  
                  
                  
                  }
    
   
}
    
void BankType::DisplayBalance(char firstName[], char lastName[], double acctBalance){
     
     
     
     for(PW!=1234){
       for(i=0;i<3;i++)
      {
       cout<<"Please Enter Account Password: "<<endl;
      cin>>PW;
      }
      
      
      for(PW==1234){
        cout<<firstName<<" "<<lastName<<endl;
        cout<<"Account Balance: "<<acctBalance<<endl;
                   
                   }
                   }
      
     
    
}



****Any help guidance or input would be greatly appreciated :)*****
Last edited on
Nobody will help you if you don't tell us what's wrong, assuming that there is something wrong with your code. If there's nothing wrong - we don't write homework for you.
If we don't know what's wrong, we can't help.
If your code doesn't use code tags, we don't want to look at your code.

Look at this thread to see how to use code tags in your posts:
http://www.cplusplus.com/forum/articles/16853/
Last edited on
Sorry first thread. I'm new to programming also. My error is telling me that there is no such BankType.h file. I'm guessing something about instantiating the object.
Thanks for the code tags post.
Instead of:

#include <BankType.h>

use :

#include "BankType.h"

You only use #include<> with files that are in the include directory of your IDE.
You use "" for files that are local to your project.
Topic archived. No new replies allowed.