Instructions
User Manual:
Open the PDF directly: View PDF .
Page Count: 12
Download | |
Open PDF In Browser | View PDF |
Project-3: Santa’s Lists F15 CSCI 232 - Data Structures and Algorithms Phillip J. Curtiss, Assistant Professor Computer Science Department, Montana Tech Museum Building, Room 105 October 14, 2015 Project-3: Due 2015-10-26 by midnight Purpose: Santa is getting ready for the upcoming Holiday Season. He has been spending all year long creating lists of those who are naughty and those who are nice. These lists can be long and difficult to manage. He would desperately like for a program where he could load these list data items, in such a way that they are sorted by country and postal code so he can then print out the list in this ordered fashion on the Big Day. The output should also include the list of gifts for each nice girl and boy, and the single gift of coal for all the naughty children. You are provided Axioms for the ADT List along with pre- and postconditions. You must provide a linked list implementation of the ADT List that conforms with the specifications (the Axioms and pre- and postconditions) and provides the behavior of the ADT List and functions as described below. Objectives: • Using UML Diagrams to Specify ADT • Using existing C++ class methods • Create methods that implement the ADT List • Manipulate Lists of Complex Data Types • Manipulate Linked List Structures • Work with Pointers in C++ • Pass objects by reference • Use C++ source file standards and doxygen to generate documentation • Modify and add features to the provided main program Obtaining the Project Files: You will complete the project using your own user account on the department’s linux system katie.mtech.edu. You should ssh into your account, and execute the command mkdir -p csci232/proj3. This will make the directory proj3 inside the directory csci232, and also create the directory csci232 if it does not yet exist - which it should from our previous lab session. You should then change the current working directory to proj3 by executing the command cd csci232/proj3. You can test that you are in the correct current working directory by executing the command pwd which should print something like /home/students//csci232/proj3, where is replaced with the username associated with your account. Lastly, execute the command tar -xzvf ~curtiss/csci232/proj3.tgz and this will expand the project files from the archive into your current working directory. You may consult man tar to learn about the archive utility and its command line options. Project-3 F15 CSCI 232 - DSA Assigned: 2015-10-14 Due: 2015-10-26 by midnight Santa’s Lists Table 1: UML Specification of ADT List +isEmpty ( ) : b o o l e a n +g et L e ng t h ( ) : i n t e g e r +i n s e r t ( n e w P o s i t i o n : i n t e g e r , newEntry : ItemType ) : b o o l e a n +remove ( p o s i t i o n : i n t e g e r ) : b o o l e a n +c l e a r ( ) : void +g e t E n t r y ( p o s i t i o n : i n t e g e r ) : ItemType +s e t E n t r y ( p o s i t i o n : i n t e g e r , newEntry : ItemType ) : void +swap ( p o s i t i o n A : i n t e g e r , p o s i t i o n B : i n t e r g e r ) : b o o l e a n +r e v e r s e ( ) : void +r e p l a c e ( p o s i t i o n : i n t e g e r , newEntry : ItemType ) : b o o l e a n +g e t P o s i t i o n ( e n t r y : ItemType ) : i n t e g e r +c o n t a i n s ( e n t r y : ItemType ) : b o o l e a n +l o a d L i s t ( s t r i n g : f i l e n a m e ) : b o o l e a n +d i s p l a y L i s t ( ) : void Project Function: Your program will be provided different test files to read where each line of the file contains the following items in the following structure: Token-0: List name ’naughty’ ’nice’ Token-1: 2-character country code Token-2: Integer-based postal code Token-3: Last Name of Girl or Boy Token-4: First Name of Girl or Boy Token-5...n: List of Single Word Strings representing gift(s) An extract of such a file: nice us 59701 coe doug chemistry_set hawaiian_shirt baseball_cap naughty ru 129 potin vladamir coal You will need to instantiate multiple lists, each with a structure where each item in the list should contain the following: • Country Code • Postal Code • Last Name • First Name • A List - of gift(s) You need to add and remove items from the list in a way that ensures the items in the list for a given set of country codes are clustered in a contiguous group, and the items within this group are ordered by their postal code. When the list is displayed, the output should be a report consisting of multiple rows of the form: Country: Gifts: us Postal Code: 59701 Last Name: coe chemistry set hawaiian shirt baseball cap ... Philip J. Curtiss, Assistant Professor Computer Science Department, Montana Tech First Name: Doug Page 2 of 12 Project-3 F15 CSCI 232 - DSA Santa’s Lists Assigned: 2015-10-14 Due: 2015-10-26 by midnight Table 2: Axioms for List ADT Axiom 1. (new List()).isEmpty() = true Axiom 2. (new List()).getLength() = 0 Axiom 3. aList .getLength() = (aList. insert ( i , x )). getLength() − 1 Axiom 4. aList .getLength() = (aList.remove(i)).getLength() + 1 Axiom 5. (aList . insert ( i , item)).isEmpty() = false Axiom 6. (new List()).remove(i) = false Axiom 7. (aList . insert ( i , x )). remove(i) = aList Axiom 8. (new List()).getEntry(i ) = error Axiom 9. (aList . insert ( i , x )). getEntry(i ) = x Axiom 10. aList .getEntry(i ) = (aList. insert ( i , x )). getEntry(i + 1) Axiom 11. aList .getEntry(i + 1) = (aList.remove(i)).getEntry(i ) Axiom 12. (new List()).setEntry( i , x) = error Axiom 13. (aList .setEntry( i , x )). getEntry(i ) = x The list of Axioms for the List ADT should not be violated in your implementation and you should definitely take care to make use of exception handling throughout your implementation to assist your program in recovering gracefully from errors. You are required to use Javadoc-style comments so doxygen can be used to create html or pdf documentation from your code. Examples of complaint comments are provided throughout the supplied source files. For further doxygen documentation see the site http://doxygen.org. Building the Project: The project includes a Makefile you may use to generate the object and executable files from source code files. Similarly, some of the source code files can be generated from the UML diagram that is also included. Consult the Makefile and understand the rules included and the dependencies and the rule sets that are used to generate the executable program. Use caution when updating the Makefile to ensure rule sets make sense. Helpful Reminders: Study and pay close attention to the provided class(es) and methods. Understand their return types and use them in the code you author to provide robust code that can handle exceptions to inputs and boundary conditions. Look at all the code provided. Read the codes’s comments and implement what is required where indicated. The feedback provided to the user may be poor in certain areas of the main driver program. Fix this and provide appropriate feedback to the end-user to inform them of what the program is doing. Make sure the user confirms actions that result in modifications to the contents of their bag. Be cognizant of the best practices we discussed in lecture and abide by good coding style - all of which will be factored into the assessment and grade for this project. Be sure to review the UML diagram and the Makefile and understand how files are being generated and their dependencies. Submission of Project: You have been provided a Makefile for this project that will help you not only build your project, but also submit the project in the correct format for assessment and grading. Toward the bottom of the provided Makefile you should see lines that look like: # Rule t o submit programming a s s i g n m e n t s t o g r a d e r s Philip J. Curtiss, Assistant Professor Computer Science Department, Montana Tech Page 3 of 12 Project-3 F15 CSCI 232 - DSA Santa’s Lists Assigned: 2015-10-14 Due: 2015-10-26 by midnight # Make s u r e you modify t h e $ ( s u b j ) $ ( msg ) above and t h e l i s t o f attachment # f i l e s i n t h e f o l l o w i n g r u l e − each f i l e n e e d s t o be p r e c e e d e d with an # −a f l a g a s shown subj = ”CSCI232 DSA − P r o j 3 ” msg = ” P l e a s e r e v i e w and g r a d e my P r o j e c t −3 S u b m i s s i o n ” submit : l i s t i n g −A1 . cpp l i s t i n g −A2 . cpp $ ( t a r ) $ (USER)− p r o j 3 . t g z $ ? echo $ ( msg ) | $ ( m a i l ) −s $ ( s u b j ) −a $ (USER)− p r o j 3 . t a r . gz $ ( addr ) Make sure you update the dependencies on the submit: line to ensure all the required files (source files) are included in the archive that gets created and then attached to your email for submission. You do not need to print out any of your program files - submitting them via email will date and time stamp them and we shall know they come from your account. If you submit multiple versions, we will use the latest version up to when the project is due. Extra Credit: Create a UML diagram that represents the relationship between classes and interfaces. You should use the UML tools in the dia graphing program. Once you generate the files, either (1) rename the existing files and replace them with the output of the dia2code -t cpp files, or (2) moify the source files to use the output of the dia2code -t cpp command - don’t forget to update the Makefile as appropriate. Questions: If you have any questions, please do not hesitate to get in contact with either Phil Curtiss (pjcurtiss@mtech.edu) or Ross Moon (rmoon@mtech.edu) at your convenicne, or stop by during office hours, and/or avail yourself of the time in the MUS lab when Ross is available. Philip J. Curtiss, Assistant Professor Computer Science Department, Montana Tech Page 4 of 12 Project-3 F15 CSCI 232 - DSA Santa’s Lists Assigned: 2015-10-14 Due: 2015-10-26 by midnight Project File Manifest: List Interface /∗ ∗ I n t e r f a c e f o r t h e ADT l i s t ∗ @file ListInterface .h ∗/ #i f n d e f LIST INTERFACE #define LIST INTERFACE #include ”Node . h” template < c l a s s ItemType > c l a s s L i s t I n t e r f a c e { public : /∗ ∗ S e e s w h e t h e r t h i s l i s t i s empty . @return True i f t h e l i s t i s empty ; o t h e r w i s e r e t u r n s f a l s e . ∗/ v i r t u a l bool isEmpty ( ) const = 0 ; /∗ ∗ Gets t h e c u r r e n t number o f e n t r i e s i n t h i s l i s t . @return The i n t e g e r number o f e n t r i e s c u r r e n t l y i n t h e l i s t . ∗/ v i r t u a l int g et L e ng t h ( ) const = 0 ; /∗ ∗ I n s e r t s an e n t r y i n t o t h i s l i s t a t a g i v e n p o s i t i o n . @pre None . @post I f 1 <= p o s i t i o n <= g e t L e n g t h ( ) + 1 and t h e i n s e r t i o n i s s u c c e s s f u l , newEntry i s a t t h e g i v e n p o s i t i o n i n t h e l i s t , o t h e r e n t r i e s a r e renumbered a c c o r d i n g l y , and t h e r e t u r n e d value is true . @param n e w P o s i t i o n The l i s t p o s i t i o n a t which t o i n s e r t newEntry . @param newEntry The e n t r y t o i n s e r t i n t o t h e l i s t . @return True i f i n s e r t i o n i s s u c c e s s f u l , or f a l s e i f not . ∗/ v i r t u a l bool i n s e r t ( int n e w Po s i t i o n , const ItemType & newEntry ) = 0 ; /∗ ∗ Removes t h e e n t r y a t a g i v e n p o s i t i o n from t h i s l i s t . @pre None . @post I f 1 <= p o s i t i o n <= g e t L e n g t h ( ) and t h e removal i s s u c c e s s f u l , t h e e n t r y a t t h e g i v e n p o s i t i o n i n t h e l i s t i s removed , o t h e r i t e m s a r e renumbered a c c o r d i n g l y , and t h e r e t u r n e d v a l u e i s t r u e . @param p o s i t i o n The l i s t p o s i t i o n o f t h e e n t r y t o remove . @return True i f removal i s s u c c e s s f u l , or f a l s e i f not . ∗/ v i r t u a l bool remove ( int p o s i t i o n ) = 0 ; /∗ ∗ Removes a l l e n t r i e s from t h i s l i s t . @post L i s t c o n t a i n s no e n t r i e s and t h e co un t o f i t e m s i s 0 . ∗/ v i r t u a l void c l e a r ( ) = 0 ; /∗ ∗ Gets t h e e n t r y a t t h e g i v e n p o s i t i o n i n t h i s l i s t . @pre 1 <= p o s i t i o n <= g e t L e n g t h ( ) . @post The d e s i r e d e n t r y has been r e t u r n e d . @param p o s i t i o n The l i s t p o s i t i o n o f t h e d e s i r e d e n t r y . @return The e n t r y a t t h e g i v e n p o s i t i o n . ∗/ v i r t u a l Node ∗ g e t E n t r y ( int p o s i t i o n ) const = 0 ; Philip J. Curtiss, Assistant Professor Computer Science Department, Montana Tech Page 5 of 12 Project-3 F15 CSCI 232 - DSA Santa’s Lists Assigned: 2015-10-14 Due: 2015-10-26 by midnight /∗ ∗ R e p l a c e s t h e e n t r y a t t h e g i v e n p o s i t i o n i n t h i s l i s t . @pre 1 <= p o s i t i o n <= g e t L e n g t h ( ) . @post The e n t r y a t t h e g i v e n p o s i t i o n i s newEntry . @param p o s i t i o n The l i s t p o s i t i o n o f t h e e n t r y t o r e p l a c e . @param newEntry The r e p l a c e m e n t e n t r y . ∗/ v i r t u a l void s e t E n t r y ( int p o s i t i o n , const ItemType & newEntry ) = 0 ; /∗ ∗ Returns t h e p o s i t i o n w i t h i n t h e L i s t o f t h e e n t r y p r o v i d e d or −1 i f not found i n t h e L i s t @pre 1 <= p o s i t i o n <= g e t L e n g t h ( ) @post none @param e n t r y t o s e a r c h f o r i n t h e L i s t @return t h e p o s i t i o n w i t h i n t h e L i s t i f e n t r y i s found , or −1 o t h e r w i s e ∗/ v i r t u a l int g e t P o s i t i o n ( const ItemType & e n t r y ) = 0 ; /∗ ∗ Returns a b o o l e a n v a l u e i n d i c a t i n g w h e t h e r t h e e n t r y p r o v i d e d i s i n t h e L i s t @pre none @post none @param e n t r y t o s e a r c h f o r i n t h e L i s t @ r e t u r n b o o l e a n v a l u e i n d i c a t i n g w h e t h e r t h e e n t r y i s i n t h e L i s t ∗/ v i r t u a l bool c o n t a i n s ( const ItemType & e n t r y ) = 0 ; /∗ ∗ l o a d s t h e L i s t w i t h e n t r i e s from t h e f i l e r e f e r e n c e d by t h e f i l e n a m e provided @pre none @post L i s t has e n t r i e s from t h e f i l e r e f e r e n c e d by t h e f i l e n a m e @param s t r i n g r e f e r e n c i n g t h e f i l e n a m e @return b o o l e a n i n d i c a t i n g i f t h e o p e r a t i o n wass s u c c e s s f u l ∗/ v i r t u a l bool l o a d L i s t ( const s t r i n g f i l e n a m e ) = 0 ; /∗ ∗ d i s p l a y s a t a b u l a r r e p r e s e n t a i t o n o f t h e L i s t @pre none @post none @param none @return v o i d ∗/ v i r t u a l void d i s p l a y L i s t ( ) = 0 ; } ; // end L i s t I n t e r f a c e #endif List Main Driver /∗ ∗ @ f i l e L i s t D r i v e r . cpp ∗ L i s t Main D r i v e r − use t o g e n e r a t e Santa L i s t ∗ ∗ @author P h i l C u r t i s s ∗ @version 1.0 ∗ @date 10/14/15 ∗∗∗∗∗∗∗∗∗∗∗∗∗∗∗∗∗∗∗∗∗∗∗∗∗∗∗∗∗∗∗∗∗∗∗∗∗∗∗∗∗∗∗∗∗∗∗∗∗∗∗∗∗∗∗∗∗ ∗/ //−−−−−−−−−−−−−−−−−−−−−−− // Using s t a t e m e n t s //−−−−−−−−−−−−−−−−−−−−−−− using namespace s t d ; Philip J. Curtiss, Assistant Professor Computer Science Department, Montana Tech Page 6 of 12 Project-3 F15 CSCI 232 - DSA Santa’s Lists Assigned: 2015-10-14 Due: 2015-10-26 by midnight //−−−−−−−−−−−−−−−−−−−−−−− // C++ i n c l u d e s //−−−−−−−−−−−−−−−−−−−−−−− #include #include #include //−−−−−−−−−−−−−−−−−−−−−−− // A p p l i c a t i o n i n c l u d e s //−−−−−−−−−−−−−−−−−−−−−−− #include ” L i s t I n t e r f a c e . h” #include ”ListADT . h” /∗ ∗ L i s t D r i v e r − use t o h e l p Santa w i t h h i s L i s t s ∗∗∗∗∗∗∗∗∗∗∗∗∗∗∗∗∗∗∗∗∗∗∗∗∗∗∗∗∗∗∗∗∗∗∗∗∗∗∗∗∗∗∗∗∗∗∗∗∗∗∗∗∗∗∗∗∗ ∗/ int main ( int argc , char ∗ argv [ ] ) { // I n s t a n t i a t e a ListADT o b j e c t L i s t I n t e r f a c e∗ n a u g h t y L i s t = new ListADT( ) ; L i s t I n t e r f a c e∗ n i c e L i s t = new ListADT( ) ; // // // if Check t o make s u r e we a r e p a s s e d one or more f i l e n a m e s t o p r o c e s s f o r Santa − i n s e r t i n t o our ListADT ( ) i n such a way t h a t t h e e n t r i e s a r e o r d e r e d and grouped . ( argc < 3){ c o u t << ” Usage ” << ” f o o ” << ” :” << e n d l ; return ( 1 ) ; } // We now have commmand l i n e arguments t o p r o c e s s , so l e t ’ s // g e t t o i t and p o p u l a t e s a n t a ’ s l i s t s i f ( n a u g h t y L i s t −>l o a d L i s t ( argv [ 1 ] ) == f a l s e ) c o u t << ” Problem r e a d i n g e n t r i e s from naughty l i s t : ” << argv [ 1 ] << e n d l ; i f ( n i c e L i s t −>l o a d L i s t ( argv [ 2 ] ) == f a l s e ) c o u t << ” Problem r e a d i n g e n t r i e s from n i c e l i s t : ” << argv [ 2 ] << e n d l ; // I f t h e l i s t has some i t e m s p r e s e n t , t h e n l e t ’ s d i s p l a y t h i s // l i s t f o r Santa c o u t << ”Your s o r t e d n i c e l i s t o f boys and g i r l s t o v i s i t : ” << e n d l ; i f ( n i c e L i s t −>isEmpty ( ) == f a l s e ) n i c e L i s t −>d i s p l a y L i s t ( ) ; else c o u t << ” Couldn ’ t f i n d any n i c e l i t t l e b o r y s and g i r l s . ; −( ” << e n d l ; // I f t h e l i s t has some i t e m s p r e s e n t , t h e n l e t ’ s d i s p l a y t h i s // l i s t f o r Santa c o u t << ”Your s o r t e d naughty l i s t o f boys and g i r l s t o v i s i t : ” << e n d l ; i f ( n a u g h t y L i s t −>isEmpty ( ) == f a l s e ) n a u g h t y L i s t −>d i s p l a y L i s t ( ) ; else c o u t << ” Couldn ’ t f i n d any naughty l i t t l e boys and g i r l s . : −) ” << e n d l ; Philip J. Curtiss, Assistant Professor Computer Science Department, Montana Tech Page 7 of 12 Project-3 F15 CSCI 232 - DSA return 0 ; } // main ( ) Santa’s Lists Assigned: 2015-10-14 Due: 2015-10-26 by midnight // E x i t program Node Header /∗ ∗ @ f i l e Node . h ∗/ #i f n d e f NODE #define NODE template < c l a s s ItemType> c l a s s Node { private : ItemType item ; // A d a t a item Node ∗ next ; // P o i n t e r t o n e x t node public : Node ( ) ; Node ( const ItemType& anItem ) ; Node ( const ItemType& anItem , Node ∗ nextNodePtr ) ; void s e t I t e m ( const ItemType& anItem ) ; void s e t N e x t ( Node ∗ nextNodePtr ) ; ItemType g e t I t e m ( ) const ; Node ∗ getNext ( ) const ; } ; // end Node #include ”Node . cpp ” #endif Node Implementation /∗ ∗ @ f i l e Node . cpp ∗/ #i f n d e f NODEIMP #define NODEIMP #include ”Node . h” #include template < c l a s s ItemType > Node < ItemType >:: Node ( ) : next ( n u l l p t r ) { } // end d e f a u l t c o n s t r u c t o r template < c l a s s ItemType > Node < ItemType >:: Node ( const ItemType & anItem ) : item ( anItem ) , next ( n u l l p t r ) { } // end c o n s t r u c t o r template < c l a s s ItemType > Node < ItemType >:: Node ( const ItemType & anItem , Node < ItemType > ∗ nextNodePtr ) : item ( anItem ) , next ( nextNodePtr ) { } // end c o n s t r u c t o r template < c l a s s ItemType > Philip J. Curtiss, Assistant Professor Computer Science Department, Montana Tech Page 8 of 12 Project-3 F15 CSCI 232 - DSA Santa’s Lists Assigned: 2015-10-14 Due: 2015-10-26 by midnight void Node < ItemType >:: s e t I t e m ( const ItemType & anItem ) { item = anItem ; } // end s e t I t e m template < c l a s s ItemType > void Node < ItemType >:: s e t N e x t ( Node < ItemType > ∗ nextNodePtr ) { next = nextNodePtr ; } // end s e t N e x t template < c l a s s ItemType > ItemType Node < ItemType >:: g e t I t e m ( ) const { return item ; } // end g e t I t e m template < c l a s s ItemType > Node < ItemType > ∗Node < ItemType >:: getNext ( ) const { return next ; } // end g e t N e x t #endif ListADT Header /∗ ∗ ∗ ListADT : Linked L i s t I m p l e m e n t a t i o n ∗/ #i f n d e f LISTADT #define LISTADT #include ” L i s t I n t e r f a c e . h” #include ”Node . h” template c l a s s ListADT : public L i s t I n t e r f a c e { private : // Whatever p r i v a t e we need public : // Must have a t l e a s t t h e s e b a s e d on I n t e r f a c e ListADT ( ) ; ˜ ListADT ( ) ; bool isEmpty ( ) const ; int g e tL e ng t h ( ) const ; bool i n s e r t ( int n e w P o s i t i o n , const ItemType& newEntry ) ; bool remove ( int p o s i t i o n ) ; Philip J. Curtiss, Assistant Professor Computer Science Department, Montana Tech Page 9 of 12 Project-3 F15 CSCI 232 - DSA Santa’s Lists Assigned: 2015-10-14 Due: 2015-10-26 by midnight void c l e a r ( ) ; Node ∗ g e t E n t r y ( int p o s i t i o n ) const ; void s e t E n t r y ( int p o s i t i o n , const ItemType& newEntry ) ; int g e t P o s i t i o n ( const ItemType& e n t r y ) ; bool c o n t a i n s ( const ItemType& e n t r y ) ; bool l o a d L i s t ( const s t r i n g f i l e n a m e ) ; void d i s p l a y L i s t ( ) ; }; #include ”ListADT . cpp ” #endif ListADT Implementation /∗ ∗ ∗ Implementation ∗/ #i f n d e f LISTADTIMP #define LISTADTIMP #include ” L i s t I n t e r f a c e . h” #include ”ListADT . h” #include ”Node . h” template ListADT : : ListADT ( ) {} template bool ListADT : : isEmpty ( ) const { return true ; } template int ListADT : : g e tL e ng th ( ) const { return 1 ; } template bool ListADT : : i n s e r t ( int n e w P o s i t i o n , const ItemType& newEntry ) { return 1 ; } template Node ∗ ListADT : : g e t E n t r y ( int p o s i t i o n ) const {Node ∗ nPtr = n u template void ListADT : : s e t E n t r y ( int p o s i t i o n , const ItemType& newEntry ) {} template int ListADT : : g e t P o s i t i o n ( const ItemType& e n t r y ) { return 1 ; } template bool ListADT : : c o n t a i n s ( const ItemType& e n t r y ) { return true ; } Philip J. Curtiss, Assistant Professor Computer Science Department, Montana Tech Page 10 of 12 Project-3 F15 CSCI 232 - DSA Santa’s Lists Assigned: 2015-10-14 Due: 2015-10-26 by midnight template bool ListADT : : l o a d L i s t ( const s t r i n g f i l e n a m e ) { return true ; } #endif Makefile # # # # # # # # # # # M a k e f i l e f o r G e n e r a t i n g C++ e x e c u t a b l e s F15 CSCI 232 − Data S t r u c t u r e s and A l g o r i t h m s P h i l l i p J . Curtiss , Associate Professor Computer S c i e n c e Department , Montana Tech Museum B u i l d i n g s , Room 105 P r o j e c t −3: Santa ’ s L i s t s Date A s s i g n e d : 2015−10−14 Date Due : 2015−10−26 by Midnight # D e f i n e Macros r e l a t e d t o p r i n t i n g and s u b m i t t i n g programs a2ps = a2ps −T 2 mail = mail addr = p c u r t i s s @ m t e c h . edu rmoon@mtech . edu tar = t a r −c v z f # D e f i n e Macros t o h e l p g e n e r a t e t h e program f i l e r e q u i r e d DIA = dia2code C++ = g++ −s t d=c++11 CFLAGS = −Wall −Werror LD = g++ LDFLAGS = LIBS = OBJS = L i s t D r i v e r . o ListADT . o Node . o EXEC = proj3 # P r o v i d e dependency l i s t s here , one on each l i n e − don ’ t f o r g e t t o make s u r e # i f you have s o u r c e f i l e s depending ( or g e n e r a t e d by ) UML diagrams t o include them a s w e l l . SUFFIXES : . dia all : $ (EXEC) $ {EXEC} : ListDriver . o ListDriver . o : L i s t I n t e r f a c e . h L i s t D r i v e r . cpp ListADT . o : ListADT . cpp L i s t I n t e r f a c e . h Node . h Node . cpp Node . o : Node . h Node . cpp ################################################################ # Rules Used t o Generate e x e c u t a b l e from o b j e c t − DO NOT EDIT $ (EXEC) : $ (OBJS) $ (LD) $ (LDFLAGS) −o $@ $ ? $ ( LIBS ) # Rule t o g e n e r a t e o b j e c t code from cpp s o u r c e f i l e s − DO NOT EDIT . cpp . o : $ (C++) $ (CFLAGS) −c $< Philip J. Curtiss, Assistant Professor Computer Science Department, Montana Tech Page 11 of 12 Project-3 F15 CSCI 232 - DSA Santa’s Lists Assigned: 2015-10-14 Due: 2015-10-26 by midnight # Rule t o g e n e r a t e h e a d e r and s o u r c e f i l e s from Dia UML Diagram − DO NOT EDIT . dia . h : $ (DIA) −t cpp $< . d i a . cpp : $ (DIA) −t cpp $< ################################################################ # Rule t o Clean up ( i . e . delete ) a l l o f t h e o b j e c t and e x e c u a b l e # code f i l e s t o f o r c e make t o r e b u i l d a c l e a r n e x e c u t a b l e o n l y # from t h e s o u r c e f i l e s clean : rm −f $ (OBJS) $ (EXEC) # Rule t o submit programming a s s i g n m e n t s t o g r a d e r s # Make s u r e you modify t h e $ ( s u b j ) $ ( msg ) above and t h e l i s t o f attachment # f i l e s i n t h e f o l l o w i n g r u l e − each f i l e n e e d s t o be p r e c e e d e d with an # −a f l a g a s shown subj = ”CSCI232 DSA − P r o j 3 ” msg = ” P l e a s e r e v i e w and g r a d e my P r o j e c t −3 S u b m i s s i o n ” submit : PLACE YOUR SOURCE CODE FILES HERE $ ( t a r ) $ (USER)− p r o j 3 . t g z $ ? echo $ ( msg ) | $ ( m a i l ) −s $ ( s u b j ) −a $ (USER)− p r o j 3 . t g z $ ( addr ) print : PLACE YOUR SOURCE CODE FILES HERE $ ( a2ps ) $ ? Philip J. Curtiss, Assistant Professor Computer Science Department, Montana Tech Page 12 of 12
Source Exif Data:
File Type : PDF File Type Extension : pdf MIME Type : application/pdf PDF Version : 1.5 Linearized : No Page Count : 12 Producer : pdfTeX-1.40.13 Creator : TeX Create Date : 2015:10:14 10:54:21-06:00 Modify Date : 2015:10:14 10:54:21-06:00 Trapped : False PTEX Fullbanner : This is pdfTeX, Version 3.1415926-2.4-1.40.13 (TeX Live 2012/Debian) kpathsea version 6.1.0EXIF Metadata provided by EXIF.tools