Question #187801

Write a class named as Bus that contains the attributes which are mentioned below: 

 The name of Bus. 

 The direction of Bus (North (N), South(S), East(E), West (W)) 

 The position of Bus (from imaginary zero point) 


Expert's answer

class Bus
{
public:
    // data fields
    string name;
    char direction;
    int position;


    Bus()
    {
        this->name = name;
        this->direction = direction;
        position = 0;
    }

};

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

LATEST TUTORIALS
APPROVED BY CLIENTS