-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathHierarchy.cs
64 lines (54 loc) · 1.21 KB
/
Hierarchy.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
abstract class Vehicle
{
protected double price;
protected int year;
protected int seatsAmount;
protected Driver driver;
protected List<Passenger> passengers;
}
abstract class LandVehicle : Vehicle
{
protected int wheelsAmount;
}
class Car : LandVehicle
{
public enum CarType { Hatchback, Sedan, Pickup, Coupe, Minivan, StationWagon };
private CarType carType;
private int horsePower;
}
class Track : LandVehicle
{
private int loadCapacity;
private int bodyVolume;
}
abstract class AirVehicle : Vehicle
{
protected int flyingHeight;
}
class Plane : AirVehicle
{
public enum PlaneType { Passenger, Cargo, Millitary };
private PlaneType planeType;
private Color color;
}
class Helicopter : AirVehicle
{
private int bladesAmount;
private int bladesLength;
}
abstract class Human
{
protected string name;
protected int age;
public enum Gender {Male, Female};
protected Gender gender;
}
class Driver : Human
{
public enum DrivingCategory { A, B, C, D, F, I, PPL, FAA};
private List<DrivingCategory> drivingCategories;
}
class Passenger : Human
{
private int bagWeight;
}