“PLEASE USE C++ IDE” 1. construct a program that will utilize the first two (2) operations of Linked List mentioned above. Your program must do the following: 1. It must be a menu-driven program with the following choices: [A] Add Pet Name [B] Display Pet Name [C] Reverse Display [D] Delete [E] Exit SAMPLE OUTPUT: MENU [A] Add Pet Name [B] Display Pet Name IC] Reverse Display [D Delete [E] Exit Enter choice: 2. For option [A], the data that the user should add in the linked list are Pet Names. You have an option to use a string or a char data type. No whitespaces are needed since only one word is used for the pet names. The program will continuously ask the user to enter pet names until letter “X” is entered. SAMPLE OUTPUT: MENU A] Add Pet Name [B) Display Pet Name [C] Reverse Display [D] Delete (E) Exit Enter choice: A Enter X to end Enter pet name to be added in the list: Brownie Enter X to end Enter pet name to be added in the list: Kitty Enter X to end Enter pet name to be added in the 1ist: x MENU [A] Add Pet Name (B) Display Pet Name [C] Reverse Display [D] Delete (E) Exit Enter choice : 3. For option [B], check if Linked List is empty. If it is empty, then display “NULL”. Otherwise, print the content of the Linked List. SAMPLE OUTPUT MENU [A] Add Pet Name [B] Display Pet Name |[C] Reverse Display [D] Delete (E] Exit Enter choice: B Brownie Kitty 4. For option [C], check if Linked List is empty. If it is empty, then display “NULL”. Otherwise, print the content of the Linked List in a reverse manner. SAMPLE OUTPUT MENU [A] Add Pet Name [B] Display Pet Name [C] Reverse Display (DI Delete [E] Exit Enter choice: C Kitty Brownie 5. For option [D], it must delete the data in the head node. SAMPLE OUTPUT MENU [A] Add Pet Name (B] Display Pet Name tC] Reverse Display [DI Delete (E) Exit Enter choice : D The head node was deleted. MENU [A] Add Pet Name [B] Display Pet Name (C] Reverse Display (D] Delete (E) Exit Enter choice: B Kitty 6. For option [E], exit the program. SAMPLE OUTPUT MENU [A] Add Pet Name [B] Display Pet Name TC Reverse Display [D] Delete [E] Exit Enter choice: E ------------------------------------------------ process exited after 292.5 seconds with return value 0 press any key to continue………...
“PLEASE USE C++ IDE”
1. construct a program that will utilize the first two (2)
operations of Linked List mentioned above. Your program must do
the following:
1. It must be a menu-driven program with the following choices:
[A] Add Pet Name
[B] Display Pet Name
[C] Reverse Display
[D] Delete
[E] Exit
SAMPLE OUTPUT:
MENU
[A] Add Pet Name
[B] Display Pet Name
IC] Reverse Display
[D Delete
[E] Exit
Enter choice:
2. For option [A], the data that the user should add in the linked
list are Pet Names. You have an option to use a string or a
char data type. No whitespaces are needed since only one word
is used for the pet names. The program will continuously ask
the user to enter pet names until letter “X” is entered.
SAMPLE OUTPUT:
MENU
A] Add Pet Name
[B) Display Pet Name
[C] Reverse Display
[D] Delete
(E) Exit
Enter choice: A
Enter X to end
Enter pet name to be added in the list: Brownie
Enter X to end
Enter pet name to be added in the list: Kitty
Enter X to end
Enter pet name to be added in the 1ist: x
MENU
[A] Add Pet Name
(B) Display Pet Name
[C] Reverse Display
[D] Delete
(E) Exit
Enter choice :
3. For option [B], check if Linked List is empty. If it is empty,
then display “NULL”. Otherwise, print the content of the Linked
List.
SAMPLE OUTPUT
MENU
[A] Add Pet Name
[B] Display Pet Name
|[C] Reverse Display
[D] Delete
(E] Exit
Enter choice: B
Brownie Kitty
4. For option [C], check if Linked List is empty. If it is empty,
then display “NULL”. Otherwise, print the content of the Linked
List in a reverse manner.
SAMPLE OUTPUT
MENU
[A] Add Pet Name
[B] Display Pet Name
[C] Reverse Display
(DI Delete
[E] Exit
Enter choice: C
Kitty Brownie
5. For option [D], it must delete the data in the head node.
SAMPLE OUTPUT
MENU
[A] Add Pet Name
(B] Display Pet Name
tC] Reverse Display
[DI Delete
(E) Exit
Enter choice : D
The head node was deleted.
MENU
[A] Add Pet Name
[B] Display Pet Name
(C] Reverse Display
(D] Delete
(E) Exit
Enter choice: B
Kitty
6. For option [E], exit the program.
SAMPLE OUTPUT
MENU
[A] Add Pet Name
[B] Display Pet Name
TC Reverse Display
[D] Delete
[E] Exit
Enter choice: E
------------------------------------------------
process exited after 292.5 seconds with return value 0
press any key to continue………...
Step by step
Solved in 2 steps with 2 images