Advertisement
elena1234

SoftUniParking- main

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