static void Main(string[] args) { Console.WriteLine("Welcome to Bucovina Guest House!"); Console.WriteLine("Select number of which type of room do you prefer to stay?"); Console.WriteLine("1->Family Room"); Console.WriteLine("2->Double Room"); Console.WriteLine("3,4->Double Room Mountain View"); Console.WriteLine("5,6->Attic Room"); int numberRoom = int.Parse(Console.ReadLine()); Console.WriteLine("How many days will you stay in our Guest House?"); int daysReserved = int.Parse(Console.ReadLine()); if (numberRoom == 1) { FamilyRoom fm = new FamilyRoom(numberRoom, daysReserved); Console.WriteLine("You reserved room no. " + numberRoom + " Days Reserved: " + daysReserved + " Price: " + fm.calculateTotalPrice()); } if (numberRoom == 2) { DoubleRoom dr = new DoubleRoom(numberRoom, daysReserved); Console.WriteLine("You reserved room no. " + numberRoom + " Days Reserved: " + daysReserved + " Price: " + dr.calculateTotalPrice()); } if (numberRoom == 3 || numberRoom == 4) { DoubleRoomMountainView drmv = new DoubleRoomMountainView(numberRoom, daysReserved); Console.WriteLine("You reserved room no. " + numberRoom + " Days Reserved: " + daysReserved + " Price: " + drmv.calculateTotalPrice()); } if (numberRoom == 5 || numberRoom == 6) { AtticRoom ar = new AtticRoom(numberRoom, daysReserved); Console.WriteLine("You reserved room no. " + numberRoom + " Days Reserved: " + daysReserved + " Price: " + ar.calculateTotalPrice()); } }
static void Main(string[] args) { FamilyRoom f = new FamilyRoom(new DateTime(2013, 1, 23), new DateTime(2013, 1, 27)); Console.WriteLine("Room price: " + f.FinalPrice(1, new DateTime(2013, 1, 23), new DateTime(2013, 1, 27)) + "\n"); SimpleDouble sd = new SimpleDouble(new DateTime(2013, 1, 23), new DateTime(2013, 1, 27)); Console.WriteLine("Double room price :" + sd.FinalPrice(2, new DateTime(2013, 1, 23), new DateTime(2013, 1, 27)) + "\n"); SpecialDouble spd = new SpecialDouble(new DateTime(2013, 1, 23), new DateTime(2013, 1, 27)); Console.WriteLine("Special double room price: " + spd.FinalPrice(5, new DateTime(2013, 1, 23), new DateTime(2013, 1, 27)) + "\n"); Mansard m = new Mansard(new DateTime(2013, 1, 23), new DateTime(2013, 1, 27)); Console.WriteLine("Mansard price: " + m.FinalPrice(6, new DateTime(2013, 1, 23), new DateTime(2013, 1, 27)) + "\n"); }