kaloyan_kolev

StartUp.cs

Jun 14th, 2019
317
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.19 KB | None | 0 0
  1. using System;
  2.  
  3. namespace SoftUniParking
  4. {
  5.     public class StartUp
  6.     {
  7.         public static void Main(string[] args)
  8.         {
  9.             var car = new Car("Skoda", "Fabia", 65, "CC1856BG");
  10.             var car2 = new Car("Audi", "A3", 110, "EB8787MN");
  11.  
  12.             Console.WriteLine(car.ToString());
  13.             //Make: Skoda
  14.             //Model: Fabia
  15.             //HorsePower: 65
  16.             //RegistrationNumber: CC1856BG
  17.  
  18.             var parking = new Parking(5);
  19.             Console.WriteLine(parking.AddCar(car));
  20.             //Successfully added new car Skoda CC1856BG
  21.  
  22.             Console.WriteLine(parking.AddCar(car));
  23.             //Car with that registration number, already exists!
  24.  
  25.             Console.WriteLine(parking.AddCar(car2));
  26.             //Successfully added new car Audi EB8787MN
  27.  
  28.             Console.WriteLine(parking.GetCar("EB8787MN").ToString());
  29.             //Make: Audi
  30.             //Model: A3
  31.             //HorsePower: 110
  32.             //RegistrationNumber: EB8787MN
  33.  
  34.             Console.WriteLine(parking.RemoveCar("EB8787MN"));
  35.             //Successfully removed EB8787MN
  36.  
  37.             Console.WriteLine(parking.Count); //1
  38.  
  39.         }
  40.     }
  41. }
Add Comment
Please, Sign In to add comment