Ugh so confused.. here's my attempt.
Code:
class Lock
{
public:
void setCode(int newCode);
void dialCode(int combo);
bool isOpen();
private:
int code;
int setting;
};
void Lock::setCode(int newCode)
{
code=newCode;
}
void Lock::dialCode(int combo)
{
if(combo=code)
{
isOpen();
}
}
bool Lock::isOpen()
{
return true;
}
int main()
{
Lock loke;
int a;
int b;
cout<<"Enter the secret lock combo"<<endl;
cin>>a;
cout<<"Guess the password"<<endl;
cin>>b;
loke.setCode(a);
loke.dialCode(b);
return(0);
}
[Edit by mod - in future, use code tags. You will get a friendlier response]