Description of this paper

COSC 2006 ???Data Structures I;Assignment #3 Due: Monday, Nov 4th, 2013;A gentle introduction to linked lists;Counterfeit money is a problem...

Description

solution


Question

COSC 2006 ? Data Structures I;Assignment #3 Due: Monday, Nov 4th, 2013;A gentle introduction to linked lists;Counterfeit money is a problem for any government that prints its own currency, and Canada is no exception. For this assignment, we are going to write a program to assist the RCMP in keeping track of counterfeit bills.;Banks keep bills, which they suspect to be counterfeit, and pass them along to the RCMP at the earliest possible opportunity. Because a group of counterfeit bills may come in at one time, they are packed together, marked with the date they were deposited, and sent to the RCMP. The RCMP receives bills from different banks at different times, meaning there is initially little ordered in which the bills are processed. Data entry technicians enter the serial number, denomination, and date found for each counterfeit bill.;Your task is to write a program which will read in a list of this data and perform some operations on it. We are going to sort the bills in the order of the date on which they were received, then provide the ability to search for serial numbers in case new counterfeit bills are found, to determine if they came from the same source. Our program will use a list of bills from many different banks, allowing the RCMP to cross-reference serial numbers (so that if a set of counterfeit bills is turned in on the same day but split up between several different banks, our program will be able to tell).;Since we are going to have an unknown number of elements in our list, we will use a linked list. Also, our list should be object-oriented, the list itself should be represented by an object of a class in which all the data members are private (only accessible through member functions), and each node in the list (representing a single counterfeit bill) should be represented using a class with private data members.;For each bill, we need to know;? Its serial number;? Its denomination ($5, $10, $20, $50, etc);? The month that it was turned in (assume all bills were turned in the same year);? The day of the month on which it was turned into the bank;The serial number will be represented by a string of letters and number, for example, xyz123456 might be a serial number. The denomination is an integer, as is the day of the month it was turned in. The name of the month it was turned in will be a string in the input file: Jan, Feb, Mar, Apr, May, Jun, Jul, Aug, Sep, Oct, Nov, Dec;An input data file might look like this;XYZ123456 20 ARZ540361 100 FPT290541 50 PAF530274 20 NLX859034 20 OPT534859 50;Jul 17 Jul 19 Jul 19 May 3 Jun 13 Jul 19;Each line of input should be read in, one at a time, and a node should be created for the linked list containing the four data members (serial number string, denomination integer, month string type, and day of month integer). The node should be added to the correct position in the linked list based on the serious number.;After reading the first line of data: head->;Second line;head-> ->;After reading in all of the data and storing it in your list, you should perform two operations on the list. First, you should print out the contents of the linked list, from start to finish, nearly in a table. For example;XYZ123456 20;July 17;ARZ540361;100 Jul 19;Serious Number: ===============;Denomination: Month Date ========== ====== =======;-;ARZ540361 100 FPT290541 50 XYZ123456 20;Jul 19 Jul 19 Jul 17;XYZ123456 20;July 17;After the list printed, it can be manipulated. The program?s user should be prompted for serial numbers to look up in the list (many bills may have been printed with the same serial number). When the user enters a serial number from the keyboard, the program performs a linea r search through the list. If the serial number isn?t found, a node should be created with this information (plus denomination, month and date given by the user) and inserted into the list in the correct position. If the serial number is found, your program should display the date on which it was found and ask if a deletion is needed.;All output should be neatly formatted.;Hand in both the source code for your program and the output after running your program on a given input file and data to be entered from the keyboard. The input file you should use is a3data.txt (I will post later). After the file is read in, input the following serial numbers;? KNV860347? GYX587379;This number doesn?t exist in the file, so enter the following information:? Denomination20;? Date: Jan 18;? ARZ540361;? A deletion is needed;? KLJ069373;? NJH537203

 

Paper#71564 | Written in 18-Jul-2015

Price : $22
SiteLock