using System; namespace Example34 { class ParkingLot { private int totalSpaces; private int occupied; public ParkingLot(int total) { totalSpaces = total; occupied = 0; } public void Enter() { bool full = IsFull(); if (!full) { occupied++; Console.WriteLine("\n**Welcome to the parking lot!"); } else { Console.WriteLine("\n**Sorry, the parking lot is full"); } } public void Leave() { if (occupied > 0) { occupied--; Console.WriteLine("\n**Good bye!"); } } public bool IsFull() { if (occupied == totalSpaces) return true; else return false; } } class Class1 { static void Main(string[] args) { ParkingLot parkingLot = new ParkingLot(5); int choice; do { Console.WriteLine("\n1. Enter.\n2. Leave. \n3. Quit"); Console.Write("\nInput your option: "); choice = int.Parse(Console.ReadLine()); switch (choice) { case 1: parkingLot.Enter(); break; case 2: parkingLot.Leave(); break; case 3: break; } } while (choice != 3); } } }