Answer to Question #187801 in C++ for Taaha Khan

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) 


1
Expert's answer
2021-05-01T23:32:32-0400
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!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS