Yea i found that info and have been testing it. I got rid of the error but having a issue now. if do this for the default constructor
Code:
Account(){
balance = 0;
}
It passes the value to
Code:
Account::Account(int a){
if (a >= 0){
balance = balance + a;
}
else {
cout << "Invalid Amount Entered" << endl;
balance = 0;
}
}
but does not update the balance figure, remains at 0.
If use this
Code:
Account(){
//balance = 0;
}
It updates the balance to 47 no matter what positive figure enter for the opening balance. However if a place a negative amount it prints the error message. So i know that its receiving the value.
edited case statement being used
Code:
case 1:{
cout << "Please Enter Opening Balance amount";
cin >> amount;
Account user1(amount);}
break;