Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- do
- {
- Console.WriteLine("What is the Airline Code?");
- AC = Console.ReadLine();
- if (AC.Length != 2)
- {
- Console.WriteLine("Error. Airline Code must be exactly 2 characters only.");
- }
- else
- {
- if (!r.IsMatch(AC))
- {
- Console.WriteLine("Error. Airline Code must be 2 alphanumeric characters only.");
- ctr = 0;
- }
- else
- {
- if (Char.IsNumber(AC[0]) && Char.IsNumber(AC[1]))
- {
- Console.WriteLine("Error. Cannot be both numbers.");
- ctr = 0;
- }
- else
- {
- ctr = 1;
- }
- }
- }
- } while (AC.Length != 2 || ctr == 0);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement