using System; namespace feb21 { class ParkingLot { private int total_spaces; private int occupied; public ParkingLot(int total) { total_spaces = 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 == total_spaces) return true; else return false; } } class Class1 { [STAThread] static void Main(string[] args) { ParkingLot park1 = 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: park1.Enter(); break; case 2: park1.Leave(); break; case 3: break; } }while ( choice != 3); } } }