static void Main(string[] args) { RideTrip rt = new RideTrip(); Route lines = new Route(); Console.WriteLine("Please Choose the Start point :"); Console.WriteLine("Stations for line1: 1 for " + lines.line1[0] + ", 2 for " + lines.line1[1] + ", 3 for " + lines.line1[2] + ", 4 for " + lines.line1[3] + ", 5 for " + lines.line1[4] + ", 6 for " + lines.line1[5] + ", 7 for " + lines.line1[6]); Console.WriteLine("--------------------------------------------"); int numOfStartPoint = int.Parse(Console.ReadLine()); rt.setnumOfStartStation(numOfStartPoint); Console.WriteLine("Please Choose the End point :"); Console.WriteLine("Stations for line1: 1 for " + lines.line1[0] + ", 2 for " + lines.line1[1] + ", 3 for " + lines.line1[2] + ", 4 for " + lines.line1[3] + ", 5 for " + lines.line1[4] + ", 6 for " + lines.line1[5] + ", 7 for " + lines.line1[6]); Console.WriteLine("--------------------------------------------"); int numOfEndPoint = int.Parse(Console.ReadLine()); rt.setnumOfEndStation(numOfEndPoint); Console.WriteLine("The Trip cost is: {0}", rt.cost(rt.getnumOfStartStation(), rt.getnumOfEndStation())); Console.ReadKey(); }
public static void Main(string[] args) { int x = 0; User u = new User(); renhere(); void renhere() { Console.WriteLine("For Register enter 1"); Console.WriteLine("Display Timline of buses Enter 2"); Console.WriteLine("For Booking Enter 3"); x = int.Parse(Console.ReadLine()); if (x == 1) { User u2 = new User(); Console.WriteLine("enter your name :"); string name = Console.ReadLine(); Console.WriteLine("enter your age:"); int age = int.Parse(Console.ReadLine()); Console.WriteLine("enter your mobile:"); string mobile = Console.ReadLine(); Console.WriteLine("--------------------------------------------"); u.register(name, age, mobile); Console.WriteLine("If you want to continue the process enter 1 :"); int ch = int.Parse(Console.ReadLine()); if (ch == 1) { renhere(); u = u2; } else { } } else if (x == 2) { Bus bs = new Bus(); bs.DisplayTimeonly(); Console.WriteLine("If you want to continue the process enter 1 "); int ch = int.Parse(Console.ReadLine()); if (ch == 1) { renhere(); } else { } } else if (x == 3) { RideTrip.display(u); //RideTrip.Booking(); RideTrip rideTrip = new RideTrip(); // RideTrip.display(); rideTrip.Booking(u); Console.WriteLine("If you want to Repeate the process enter 1 "); int ch = int.Parse(Console.ReadLine()); if (ch == 1) { renhere(); } else { } } else { } } Console.ReadKey(); }