Ok this one is a doosey! I don't know if anyone will understand but I will try my best to explain what I want done.
Here is an example class:
Could I make it where if gasInTank<=0 then they could not PutInGear? Not sure if that sounds clear to anyone. Basically I want the function StartUp to determine, based on user input, if there is enough gass in the car to be able to use the PutInGear Function. I think I saw this in another thread, will I have to use bool type arguments? Such as:Code:class Car { public: int StartUp(int gasInTank); void PutInGear(); void Accelerate(); void SlowDown(); void FloorIT(); char GetMake(char* carMake); char GetModel(char* carModel); int GetYearMade(); private: int YearMade; char Model; char Make; };
In other words: If StartUp fails then the user will not be able to PutInGear.Code:Car::StartUp(int gasInTank) { if (gasInTank<=0) { StartUp = fail cout <<"You need more gas to start your car" <<endl; } else cout <<"Your car starts-up smoothly" <<endl; }
If this makes anysense at all please give me INFORMATION (i.e. threads, links, google search keywords, to things that I will need to know in order to pull this off. (if its possible)