Password problem

Ok still have a problem with this task. I need a boolean password for my atm. However if i input the incorrect password the program still continues.
// My main where my password is
1
2
3
4
5
6
7
8
9
10
11
12
13
14
  int main()
{
	Account acc("01");
	acc.activateAccount("Megan Duncan");
	acc.setBalance(500.00);
	
	Card c("12345");
	c.activateCard(&acc, 4812); //password set to 4812
	
	ATM a;
	a.run(&c);
	
	return 0;
}


// My header file

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
class Card
{

	private:
		
		int pin;
	
	public:
	
		Card(string num);
		
	
		~Card();
		
		
		bool checkPin(int input) const;
		
};



//MY implementation files

// in card.cpp

1
2
3
4
5
bool Card::checkPin(int input) const{
		if(input == pin)
			return true;
		else return false;
	}


//calling it in atm
1
2
3
4
5
6
7
8
9
10
void ATM::insertCard(Card* c){
		int pin;
		string accHold;
		cout << "Welcome. Please enter the pin for the entered card." << endl;
		cin >> pin;
		(*c).checkPin(pin);
		cout << "Verifying, Please wait..." << endl;
		cout << "Welcome " << (*currentCard).getAccountHolder() << "!" << endl << endl;
		
	}


Sorry I am asking so many questions but i really want to learn
interesting - thanks!
yea no problem
Topic archived. No new replies allowed.