#include // Kompilera med // g++11 -Woverloaded-virtual -Weffc++ // GIVEN BASKLASS - ÄNDRAS BARA LITE class Employee { public: Employee(std::string n, int s) : name(n), salary(s) {} ~Employee() = default; int getSalary() const { return salary; } std::string getName() const { return name; } private: std::string name; int salary; }; // LÄGG TILL SUBKLASSER HÄR ! #include // GIVET - ÄNDRAS BARA LITE int main() { std::vector v; // DESSA TRE RADER FÅR ÄNDRAS v.push_back(new Employee("Andersson", 30000)); v.push_back(new Employee("Pettersson", 24000)); v.push_back(new Employee("Lundström", 180)); for (unsigned i = 0; i < v.size(); ++i) { std::cout << v.at(i)->getSalary() << "kr skall betalas till " << v.at(i)->getName() << std::endl; } // LÄGG TILL MINNESHANTERING HÄR !! return 0; }