Exemplo n.º 1
0
        public override string ToString()
        {
            string formattedUtilities  = Utilities ? "Yes" : @"N/A";
            string formattedRV         = Max_Rv_Length == 0 ? @"N/A": Max_Rv_Length.ToString();
            string formattedAccessible = Accessible ? "Yes" : "No";
            string result = ($"{Site_Number.ToString().PadRight(10)}{Max_Occupancy.ToString().PadRight(15)}{formattedAccessible.PadRight(15)}{formattedRV.PadRight(15)}{formattedUtilities.PadRight(15)}");

            return(result);
        }
Exemplo n.º 2
0
 public void DisplaySite(int numOfDays)
 {
     Console.Write(Site_Number.ToString().PadRight(12));
     Console.Write(Max_occupancy.ToString().PadRight(12));
     Console.Write((Accessibile ? "Yes" : "No").ToString().PadRight(15));
     if (Max_rv_length == 0)
     {
         Console.Write("N/A".PadRight(18));
     }
     else
     {
         Console.Write(Max_rv_length.ToString().PadRight(18));
     }
     Console.Write((Utilities ? "Yes" : "No").ToString().PadRight(12));
     Console.WriteLine("$" + (Daily_Fee * numOfDays).ToString() + ".00".PadRight(12));
 }
 public override string ToString()
 {
     return(Site_ID.ToString() + Campground_ID.ToString() + Site_Number.ToString() + Max_Occupancy.ToString() + Accessible.ToString() + Max_RV_Length.ToString() + Utilities.ToString());
 }
Exemplo n.º 4
0
 public string ToStringWithName()
 {
     return(Campground_Name.PadRight(35) + Site_Number.ToString().PadRight(15) + Max_Occupancy.ToString().PadRight(15) + (Accessible ? "Yes" : "No").PadRight(20) + (Max_RV_Length == 0 ? "N/A" : Max_RV_Length.ToString()).PadRight(20) + (Utilities ? "Yes" : "N/A").PadRight(15));
 }
Exemplo n.º 5
0
 public override string ToString()
 {
     return(Site_Number.ToString().PadRight(15) + Max_Occupancy.ToString().PadRight(15) + (Accessible?"Yes":"No").PadRight(20) + (Max_RV_Length == 0?"N/A":Max_RV_Length.ToString()).PadRight(20) + (Utilities?"Yes":"N/A").PadRight(15));
 }