Advertisement
Guest User

Untitled

a guest
Apr 24th, 2018
75
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.62 KB | None | 0 0
  1. void editPassenger(struct node* top, int entry)
  2. {
  3. struct node* curr;
  4. int choice;
  5.  
  6. curr = top;
  7.  
  8. while (curr != NULL)
  9. {
  10. if (curr->passportNum == entry)
  11. {
  12. printf("Positive match. What would you like to edit?\n");
  13. printf("[1]-Passport Number\n[2]-First Name\n[3]-Second Name\n");
  14. printf("[4]-Year of birth\n[5]-Email Address\n[6]Travel From\n");
  15. printf("[7]-Travel Class\n[8]-Trips to Ireland\n[9]-Duration in Ireland\n");
  16. scanf("%d\n", &choice);
  17.  
  18. switch (choice)
  19. {
  20. case 1:
  21. printf("Enter the new passport number:\n");
  22. scanf("%d", curr->passportNum);
  23. break;
  24. case 2:
  25. printf("Enter the new first name:\n");
  26. scanf("%s", curr->firstName);
  27. break;
  28. case 3:
  29. printf("Enter the new second name:\n");
  30. scanf("%s", curr->secondName);
  31. break;
  32. case 4:
  33. printf("Enter the new year of birth:\n");
  34. scanf("%d", curr->yearBorn);
  35. break;
  36. case 5:
  37. printf("Enter the new email address:\n");
  38. scanf("%s", curr->emailAddress);
  39. break;
  40. case 6:
  41. printf("Enter the new travel from:\n");
  42. scanf("%s", curr->travelFrom);
  43. break;
  44. case 7:
  45. printf("Enter the new travel class:\n");
  46. scanf("%s", curr->travelClass);
  47. break;
  48. case 8:
  49. printf("Enter the new trips to Ireland:\n");
  50. scanf("%s", curr->tripNum);
  51. break;
  52. case 9:
  53. printf("Enter the new duration in Ireland:\n");
  54. scanf("%s", curr->tripDuration);
  55. break;
  56. default:
  57. printf("Invalid input\n");
  58. }//endSwitch
  59. }//endIf
  60. curr = curr->NEXT;
  61. }
  62. printf("Passport number cannot be found or is invalid.\n");
  63. main();
  64. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement