Question: #include #include class Vehicle { protected: std::string brand; int capacity; public: Vehicle ( const std::string& brand, int capacity ) : brand ( brand ) ,
#include
#include
class Vehicle
protected:
std::string brand;
int capacity;
public:
Vehicleconst std::string& brand, int capacity
: brandbrand capacitycapacity
virtual void move;
;
class Car : public Vehicle
private:
std::string model;
int year;
public:
Carconst std::string& brand, const std::string& model, int year
: Vehiclebrand modelmodel yearyear
void move override
std::cout "Driving the car: brand model year std::endl;
;
class Train : public Vehicle
private:
std::string name;
public:
Trainconst std::string& name, int capacity
: VehicleTrain capacity namename
void move override
std::cout "The train name is running with a capacity of capacity passengers." std::endl;
;
int main
Car myCarToyota "Camry", ;
Train myTrainExpress;
myCar.move;
myTrain.move;
return ;
Please represent this code in UML
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
