FAQ | Newsboard | Telnet | Email TA | Lectures | Assignments | Man pages | Help |
---|
This assignment gets you familiar with linked lists, dynamic allocation, and de-alloction, and interactive input. Many applications in the real world are similar to the problem outlined below. Reservation systems, inventory systems, and many ATM systems are realizations of this same problem. The main difference: instead of dealing with databases and complicated input information, I am only asking you to deal with integers. Good luck
Design and implement a program that reads integers from an input file, sorts them in ascending order, and stores them in a linked list. Your program will have two command line arguments: the number of integers in the input file, and the name of an input file.
After reading the required number of inputs from the input file, your program should then read pairs of inputs from standard input until the end of file (the user types <ctrl> D). At this point the program should print the integers stored in the linked list on the screen and exit.
Each input pair (read from stdin) consists of a character and an integer. Only 'i', 'p', and 'd' are legal characters.
As usual there are some constraints:
In the real world, you seldom get much in the way of sample inputs and outputs. Pretend that you have been given these program specifications and constraints by a client of the firm you work for. So far I have made most of the design, robustness, generality, and testing decisions for you. This time, you decide. If you have questions, try following the spirit of the code and assignment solutions that I have provided throughout the course to obtain an answer. I suggest, even encourage, you to ask me questions (email is good), I may or may not give you the answer but will give you some help. Software design in the real world is a morass of deadlines, incorrect specifications, confused clients, and limited resources. Welcome!