mirror of
https://github.com/markjprice/cs11dotnet7.git
synced 2026-04-06 14:53:47 +00:00
Initial commit
This commit is contained in:
parent
04b31e6eb8
commit
5108079993
26 changed files with 123 additions and 38 deletions
34
vscode/Chapter05/PacktLibraryNetStandard2/FlightPatterns.cs
Normal file
34
vscode/Chapter05/PacktLibraryNetStandard2/FlightPatterns.cs
Normal file
|
|
@ -0,0 +1,34 @@
|
|||
namespace Packt.Shared;
|
||||
|
||||
public class Passenger
|
||||
{
|
||||
public string? Name { get; set; }
|
||||
}
|
||||
|
||||
public class BusinessClassPassenger : Passenger
|
||||
{
|
||||
public override string ToString()
|
||||
{
|
||||
return $"Business Class: {Name}";
|
||||
}
|
||||
}
|
||||
|
||||
public class FirstClassPassenger : Passenger
|
||||
{
|
||||
public int AirMiles { get; set; }
|
||||
|
||||
public override string ToString()
|
||||
{
|
||||
return $"First Class with {AirMiles:N0} air miles: {Name}";
|
||||
}
|
||||
}
|
||||
|
||||
public class CoachClassPassenger : Passenger
|
||||
{
|
||||
public double CarryOnKG { get; set; }
|
||||
|
||||
public override string ToString()
|
||||
{
|
||||
return $"Coach Class with {CarryOnKG:N2} KG carry on: {Name}";
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue