public class Ticket
{
private int _Distance;
private double _Price;
public int Distance {
get {
return this._Distance;
}
}
public double Price {
set {
this._Price = value;
}
get {
if (this.Distance < 100) {
return (double)this.Distance;
}
else if (this.Distance < 200) {
return (double)this.Distance * .9;
}
else {
return (double)this.Distance * 8;
}
}
}
}