Advertisement
Guest User

CODE

a guest
Jan 18th, 2018
84
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.72 KB | None | 0 0
  1. do
  2. {
  3. Console.WriteLine("What is the Airline Code?");
  4.  
  5. AC = Console.ReadLine();
  6. if (AC.Length != 2)
  7. {
  8. Console.WriteLine("Error. Airline Code must be exactly 2 characters only.");
  9. }
  10. else
  11. {
  12. if (!r.IsMatch(AC))
  13. {
  14. Console.WriteLine("Error. Airline Code must be 2 alphanumeric characters only.");
  15. ctr = 0;
  16. }
  17. else
  18. {
  19. if (Char.IsNumber(AC[0]) && Char.IsNumber(AC[1]))
  20. {
  21. Console.WriteLine("Error. Cannot be both numbers.");
  22. ctr = 0;
  23. }
  24. else
  25. {
  26. ctr = 1;
  27. }
  28.  
  29.  
  30. }
  31.  
  32. }
  33. } while (AC.Length != 2 || ctr == 0);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement