Thread: Need for function define

  1. #1
    Registered User
    Join Date
    Aug 2008
    Posts
    2

    Need for function define

    Can any one help to define ??? part in my data structure project?
    thanks.

    Code:
    ....
    ...
    
    struct Customer{
       int  tckimlikno;   // customer identity number
       string name;
       string surname;
       void set(int a, string b, string c);
    };
    
    struct customerNode
    {
    	Customer person;
    	customerNode * next, *prev;
    	customerNode():next(NULL),prev(NULL){};
    };
    
    class activity
    {	
    	int actNo,size;
    	string actName;
    	customerNode *headc,*tailc;
    	customerNode * searchID(int);
    
    public:
    	activity(int a , string b);
    	activity();
    	int getAct() { return actNo; };
    	string getName() { return actName; };
    	int getSize() { return size; };
    	void add(Customer & C);
    	void deleteCustomer(int);
    	void print() const;
    };
    
    activity::activity()
    {
        headc = NULL;
        tailc = NULL,
        size = 0;
        actNo = 0;
        actName = "";
    }
    
    activity::activity(int a , string b)
    {
        headc=NULL;
        tailc = NULL;
        size = 0;
        actNo = a;
        actName = b;
    }
    
    
    
    class Tree{
    
    public:
    	struct treeNode{
    		activity element;
    		treeNode *left,*right;
    		treeNode():left(NULL),right(NULL){};
    	};
    
    	Tree():root(NULL),treesize(0){};
    	treeNode * nodeSearch(int acno, string actname, treeNode * node);
    	treeNode * getRoot() { return root; };
    	void addAct(activity & dep);
    	void removeAct(int acno, string actname);
    	int deleteTree(treeNode *treep);
    private: 
    	treeNode *root;
    	int treesize;
    
    };
    
    void Customer::set(int a, string b, string c)
    {
     tckimlikno = a;	name = b; surname = c;
    };
    
    customerNode * activity::searchID(int _id)
    {
    
    ????????????????????????????????????????????
    	
    }
    
    void activity::add(Customer &C)
    {
       -
    }
    
    void activity::deleteCustomer(int id)
    {
    -
    
    }
    
    void activity::print() const
    {
    -
    };
    
    Tree::treeNode * Tree::nodeSearch(int acno, string actname,Tree::treeNode *node)
    {
    -
    }
    
    int Tree::deleteTree(Tree::treeNode *treep)
    {
    -
    }
    
    void Tree::removeAct(int acno, string actname)
    {	
    -}
    }
    
    void Tree::addAct(activity &act)
    {
     ???????????????????????*
    
    }
    
    void menu()
    {
     cout << "MENU" << endl;
    	cout << "1- Add a activity" << endl;
    
    }
    
    int main()
    {
     ....
    
     		case 1:
    		{
    			int a;
    			string b;
    			cout << "Enter new activity name: ";
    			cin >> b;
    			cout << "Enter the activity code: ";
    			cin >> a;
    			activity newAct(a,b);
    			menucontent.addAct(newAct);
    			break;
    		}
    
    	  ....
    	}
    	return 0;
    }

  2. #2
    Kernel hacker
    Join Date
    Jul 2007
    Location
    Farncombe, Surrey, England
    Posts
    15,677
    Short answer: No!

    Longer answer: You make your best effort, and we will help you get further. This isn't "do other peoples homework so you can get the credit", it is a help foruim for people who want to learn about C, C++ and related topics.

    --
    Mats
    Compilers can produce warnings - make the compiler programmers happy: Use them!
    Please don't PM me for help - and no, I don't do help over instant messengers.

  3. #3
    Registered User
    Join Date
    Aug 2008
    Posts
    2
    So also i did the &#37;90 of the project. And i only asked the 2 function define.
    And i didnt say you must do it. i only asked can you help me.
    and if the people want to leant c/c++, you can examine this project, and if anyone want, i can send the all project source code, it doesnt matter for me.

  4. #4
    and the Hat of Guessing tabstop's Avatar
    Join Date
    Nov 2007
    Posts
    14,336
    I don't think 90% of the functions are going to be question marks; they just don't come up that often.

    And if you did actually do the rest of the program, you wouldn't be asking this (you can write nodeSearch but not searchID? you can write removeAct but not addAct?) so hey.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Pointer within a Struct
    By Bladactania in forum C Programming
    Replies: 11
    Last Post: 04-03-2009, 10:20 PM
  2. Why?!?
    By p3rry in forum C Programming
    Replies: 3
    Last Post: 01-08-2009, 12:52 PM
  3. size of an integer pointer
    By onebrother in forum C Programming
    Replies: 5
    Last Post: 07-09-2008, 11:49 AM
  4. edit controls in dialogs
    By Homunculus in forum Windows Programming
    Replies: 10
    Last Post: 02-23-2006, 03:38 PM
  5. Please STICKY this- vital to MSVC 6 dev - BASETSD.h
    By VirtualAce in forum Game Programming
    Replies: 11
    Last Post: 03-15-2005, 09:22 AM