Question: Please carefully read the following requirements and please code the program in C language . Thank you For any given state/city, there may be many

Please carefully read the following requirements and please code the program in C language. Thank you

Please carefully read the following requirements and please code the program in

For any given state/city, there may be many lines in the file. The lines towards the bottom of the file represent the most recent temperatures. Write a program which does the following: 1. Prompts the user to enter the name of the input file; if the user does not enter a name, use a default file name, such as temperatures . txt 2. Reads the data from file into an ordered list of stacks. The list is sorted in ascending order by the state/city string, a unique key. The temperature values for a given state/city are pushed onto its stack. (See example below). - The stack nodes contain - an integer (temperature) and a pointer to the next stack node. - The list nodes contain - a state/city string. - a pointer to the next state/city node, - a pointer to the previous state/city node, - a pointer to the stack of temperature nodes for that state/city, a count of the nodes in the stack, and Requirement: create a circular doubly-linked list with one sentinel node 3. Displays the sorted list in ascending order (state/city and only one temperature value - at the top of the stack. (AZ) 4. Displays the sorted list in descending order (state/city and only one temperature value - at the top of the stack. (ZA). 5. Search loop. Prompts the user for a state/city string. If the state/city string is in the list, display the most recent temperature and the average temperature for that state/city. Give an error message if the state/city string is not found in the list. Prompts the user repeatedly until s/he enters "quit". EXAMPLE // input fte //2 nodes in the linked list: each node has its own stack Arizona, Tucson:99 Oregon, Portland: 85 Arizona, Tucson: 90 Oregon, Portland: 75 Arizona, Tucson: 100 INPUT FILE: temperatures . txt Pennsylvania, Philadelphia : 91 California, San Francisco: 75 Nevada, Reno: 108 Arizona, Flagstaff: 81 California, Yreka: 101 Arizona, Tucson: 107 California, Los Angeles: 78 California, Los Angeles: 81 Pennsylvania, Pittsburgh: 89 Oregon, Salem: 90 California, Los Angeles: 82 Arizona, Flagstaff: 84 California, San Francisco: 64 Oregon, Salem: 83 California, San Francisco: 68 Arizona, Tucson: 99 California, Yreka: 100 Arizona, Phoenix: 109 Oregon, Portland: 82 Arizona, Tucson: 103 Oregon, Portland: 79 Arizona, Phoenix: 107 California, Cupertino: 88 California, San Francisco: 82 Arizona, Tucson: 109 Oregon, Salem: 85 Pennsylvania, Philadelphia : 86 California, Los Angeles:97 Nevada, Reno: 108

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!