Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- void editPassenger(struct node* top, int entry)
- {
- struct node* curr;
- int choice;
- curr = top;
- while (curr != NULL)
- {
- if (curr->passportNum == entry)
- {
- printf("Positive match. What would you like to edit?\n");
- printf("[1]-Passport Number\n[2]-First Name\n[3]-Second Name\n");
- printf("[4]-Year of birth\n[5]-Email Address\n[6]Travel From\n");
- printf("[7]-Travel Class\n[8]-Trips to Ireland\n[9]-Duration in Ireland\n");
- scanf("%d\n", &choice);
- switch (choice)
- {
- case 1:
- printf("Enter the new passport number:\n");
- scanf("%d", curr->passportNum);
- break;
- case 2:
- printf("Enter the new first name:\n");
- scanf("%s", curr->firstName);
- break;
- case 3:
- printf("Enter the new second name:\n");
- scanf("%s", curr->secondName);
- break;
- case 4:
- printf("Enter the new year of birth:\n");
- scanf("%d", curr->yearBorn);
- break;
- case 5:
- printf("Enter the new email address:\n");
- scanf("%s", curr->emailAddress);
- break;
- case 6:
- printf("Enter the new travel from:\n");
- scanf("%s", curr->travelFrom);
- break;
- case 7:
- printf("Enter the new travel class:\n");
- scanf("%s", curr->travelClass);
- break;
- case 8:
- printf("Enter the new trips to Ireland:\n");
- scanf("%s", curr->tripNum);
- break;
- case 9:
- printf("Enter the new duration in Ireland:\n");
- scanf("%s", curr->tripDuration);
- break;
- default:
- printf("Invalid input\n");
- }//endSwitch
- }//endIf
- curr = curr->NEXT;
- }
- printf("Passport number cannot be found or is invalid.\n");
- main();
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement