SHARE
TWEET

Car.cs

a guest Nov 19th, 2019 85 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Threading.Tasks;
  6.  
  7. namespace CW5
  8. {
  9.     public class Car
  10.     {
  11.         protected int cylilndersCount;
  12.         protected string model;
  13.         protected double power;
  14.  
  15.         public int CylilndersCount
  16.         {
  17.             get { return cylilndersCount; }
  18.             private set { }
  19.         }
  20.  
  21.         public string Model
  22.         {
  23.             get { return model; }
  24.             private set { }
  25.         }
  26.  
  27.         public double Power
  28.         {
  29.             get { return power; }
  30.             private set { }
  31.         }
  32.         public Car()
  33.         {
  34.             cylilndersCount = 0;
  35.             model = "VAZ";
  36.             power = 0.0;
  37.         }
  38.  
  39.         public Car(int cylilndersCount, string model, double power)
  40.         {
  41.             this.power = power;
  42.             this.cylilndersCount = cylilndersCount;
  43.             this.model = model;
  44.         }
  45.     }
  46.  
  47.     public class Lorry : Car
  48.     {
  49.         protected double carryingCapacity;
  50.         public double CarryingCapacity
  51.         {
  52.             get { return carryingCapacity; }
  53.             private set { }
  54.         }
  55.  
  56.        public void ChangeCarryingCapacity(double cap) { carryingCapacity = cap; }
  57.         public void ChangeModel(string model) { this.model = model; }
  58.         public Lorry(double carryingCapacity, int cylilndersCount, string model, double power) : base(cylilndersCount, model, power)
  59.         {
  60.             this.carryingCapacity = carryingCapacity;
  61.         }
  62.  
  63.     }
  64. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Not a member of Pastebin yet?
Sign Up, it unlocks many cool features!
 
Top