Untitled
sdunknown
plain_text
4 years ago
744 B
9
Indexable
interface ICars
{
void Purchase();
}
class Car : ICars
{
public string Brand { get; set; }
public string Model { get; set; }
public int ID { get; set; }
public int Year { get; set; }
public float Price { get; set; }
public int Stock { get; set; }
public Car(string br, string mod, int id, int yea, float pri)
{
this.Brand = br;
this.Model = mod;
this.ID = id;
this.Year = yea;
this.Price = pri;
this.Stock = 100;
}
public int StillInStock(int request)
{
this.Stock -= request;
return this.Stock;
}Editor is loading...