chore: Add course material

This commit is contained in:
2026-10-05 11:27:21 +02:00
parent 971813c351
commit e8241fd1ff
660 changed files with 26658 additions and 1 deletions
@@ -0,0 +1,37 @@
#include "Person.h"
#include "PersonException.h"
#include "YoungPerson.h"
#include <iostream>
using std::cout;
Person::Person(std::string name, int age) : name(name), age(age) {
if (age < 0) {
throw PersonException("negative age");
}
cout << "Person ctor\n";
Count++;
}
Person::Person(const Person &) {
cout << "Copy ctor\n";
Count++;
}
Person::~Person() {
cout << "Dtor\n";
Count--;
}
void Person::setSalary(int sal) {
if (sal < 0) {
throw PersonException("negative salary");
}
salary = sal;
}
int Person::GetCount() { return Count; }
int Person::Count = 0;