diff --git a/Autonomous.h b/Autonomous.h new file mode 100644 index 0000000..708f5bd --- /dev/null +++ b/Autonomous.h @@ -0,0 +1,7 @@ +class Autonomous +{ + public: + virtual int range() = 0; + protected: + int radius; +}; diff --git a/Truck.cpp b/Truck.cpp new file mode 100644 index 0000000..1b961fd --- /dev/null +++ b/Truck.cpp @@ -0,0 +1,24 @@ +class Truck : public Vehicle, public Autonomous { + + public: + Truck(std::string a, int b){ + Truck::set_values(a,b); + float Truck::getPrice(); + }; + + void set_values(std::string a,int b){ + brand = a; + year = b; + }; + + float getPrice(){ + return 0; // do magic + } + + void range(){ + //i am 12 and what is this? + } + + float getCost(){ + return getPrice(); + } diff --git a/Truck.h b/Truck.h new file mode 100644 index 0000000..e69de29 diff --git a/Vehicle.cpp b/Vehicle.cpp new file mode 100644 index 0000000..569b2c2 --- /dev/null +++ b/Vehicle.cpp @@ -0,0 +1,6 @@ +#include "vehicle.h" + +Vehicle::Vehicle() +{ + cost = 0; //free car :) +} diff --git a/Vehicle.h b/Vehicle.h new file mode 100644 index 0000000..6236ec4 --- /dev/null +++ b/Vehicle.h @@ -0,0 +1,13 @@ +#ifndef VEHICLE_H_ +#define VEHICLE_H_ + +class Vehicle +{ + protected: + float cost; + public: + Vehicle(); + virtual float getCost() = 0; +}; + +#endif