EGRE 246 Advanced Engineering Programming Using C++ Homework #3 – Linked Lists

$30.00

Category: You will Instantly receive a download link for .zip solution file upon Payment || To Order Original Work Click Custom Order?

Description

5/5 - (2 votes)

This homework must be your own (individual) work as defined in the course syllabus and
discussed in class.
Write a C program to maintain rainfall data, the data should be stored using a singly
linear linked list. For this homework you are given a header file that contains the
structure to be used for the linked list and a set of function prototypes that you have to
implement (in a separate source file).
Your program will start of building the linked list based on the data that the user inputs as
shown below in the screenshot:
The user is asked for how many months of data should be entered and what the starting
year and month is. Subsequently the user should be requested to input all of the data for
each month. Make sure to correctly display the month and year as shown in the above
screenshot (where the year is automatically incremented and the month is reset to 1). If
the user decides to not log any months (answer to the first question is 0) then the program
should cleanly exit right away.
Once all the data has been entered a menu should be shown giving the options to display
the month with the highest (option 1) and lowest monthly rainfall (option 2). Option 3
should calculate the total average monthly rainfall and option 4 should display all the
recorded data. Option 0 should cleanly exit your program and clean-up the linked list
(free all memory).
Option 5 lets the user change a data entry where the user will be asked first what year and
month and then what the new rainfall data should be. If the entry based on the year and
month cannot be found this should be reported back to the user. As shown in the next
screenshot
When the menu is displayed the program should only accept a valid entry (i.e. one of the
choices) otherwise the menu should be displayed again (no warning message necessary).
For this homework you are given a header file called “rainfall.h”, as a requirement for
this homework you will have to use the structure “monthly_rainfall” as the basis for your
linked list. You are also required to implement all the function prototypes in the header
file that supports the menu functionality. You cannot change/alter “rainfall.h” and your
implemented functions should look exactly like the function prototypes.
For this homework you should submit:
1. main.c – with the main() function
2. rainfall.c – with the implemented functions
3. rainfall.h – given to you, but submit this file so a complete project directory is
created.
4. Makefile – a file that compiles your project.
Remember the class policy on late submissions – no late submissions are allowed unless
prior arrangement is made with the instructor.