Summary Files Commits Branches @commit @diff @stats
path: root / Year 1 / Object-oriented Programming / Exam 2 Preparation / Automobile.cpp
blob: 9eb6cc47f9f07453c94fb7547969ac0314de14fa (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
#include "Automobile.h"

Automobile::Automobile(String brand, unsigned maxSpeed) : Vehicle(brand, (maxSpeed >= 180 && maxSpeed <= 240) ? maxSpeed : 180)
{}

unsigned Automobile::getSpeedOnRoad(Road road) const {
	return Vehicle::getMaxSpeed();
}

Automobile* Automobile::clone() const {
	return new Automobile(*this);
}