Write a linked-list program using program 12.3 studied in class, in which the listNode structure is replaced with the members of the PET structure from program problem 12.1. Show in the output screenshot(s) the addition of the four pet records and the deletion of the cat record from the linked list. Hint: Use for the get name function strcmp() to determine where to insert the new pet in the linked list.
in c lanaguage only please. i only need help with 12.2. and please make sure it includes the addition of 4 new pet records and the deletion of the cat record.
thank you again
COP-2270 Lab 12
Write C programs for the problems below. Make sure to include in the file the source code in text and the
Exercise
Lab12.1
Write a program called mypets in which uses a typedef structure called PET defined as follow. PET data contains three members; the type of pet, the name of the pet, and its age. You should use in the program dynamic memory allocation, that you learned this week to create an array of PET objects. The pet information is entered by the user, and stored in a PET array as shown below. Finally, the program should output the pet information from the PET array. Make sure the program frees all memory before exiting.
Type
Name
Age
Dog
Terry
Taby
Cat
5 10
Parrot
Rabbit
Douglas
Bunker
30
2
Lab12.2
Write a linked-list program using program 12.3 studied in class, in which the listNode structure is replaced with the members of the PET structure from program problem 12.1. Show in the output screenshot(s) the addition of the four pet records and the deletion of the cat record from the linked list.
Hint: Use for the get name function strcmp() to determine where to insert the new pet in the linked list.
Trending now
This is a popular solution!
Step by step
Solved in 3 steps