C/C++ Help
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
User Name:
Password:
Remember me
 
Go Back   Dev Articles Community ForumsProgrammingC/C++ Help

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Display Modes
 
Unread Dev Articles Community Forums Sponsor:
  #1  
Old March 18th, 2006, 09:55 PM
jandali jandali is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Feb 2006
Posts: 18 jandali User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 7 h 6 m 23 sec
Reputation Power: 0
Help needed

Code:
Original - Code
    [CPAN="php"][MYSQL=""]#ifndef _TREEDB_H #define _TREEDB_H #include "treeNode.h" class studentDB { private:   treeNode* root;   int probesCount; public: // the default constructor, creates an empty database.     studentDB(); // the destructor, deletes all the records in the database.     ~studentDB(); // inserts a copy of the record pointed to by newRecord into the database. // If a record with the same student number as newRecord's exists // in the database, it returns false. Otherwise, it returns true. // If database is full, it silently fails.     bool insert(studentRecord* newRecord); // searches the database for a record with studentNum, // if the record is found, its content will be copied to // the searchRecord, and the method returns true. Otherwise // the method returns false.     bool retrieve(unsigned int studentNum, studentRecord* searchRecord); / deletes the record with studentNum from the database. If // the record was indeed in the database, it returns true. // Returns false otherwise.     bool remove(unsigned int studentNum); // deletes all the records in the database.     void clear(); // returns true if there is no record in the database, otherwise,it returns false.     bool isEmpty(); // returns true if the database is full, i.e. no further //studentrecords can be inserted into the database, otherwise, it returns     // false.     bool isFull();     // writes the number of probes performed by the last invocation of the     //  "retrieve" method to the standard output.  Look at the assignment     //  specification for the definition of a probe.     void printProbes();     // dumps the content of the database to the standard output (using     // the "print" method of the studentRecord class), sorted in ascending     // order of student numbers, separated by empty lines.     void dump(); }; //studentDB


#endif
[B]i need help with the three functions
bool insert(studentRecord* newRecord);
bool remove(unsigned int studentNum);
bool retrieve(unsigned int studentNum, studentRecord* searchRecord)

Reply With Quote
  #2  
Old March 18th, 2006, 10:05 PM
ubergeek ubergeek is offline
Contributing User
Dev Articles Novice (500 - 999 posts)
 
Join Date: Jan 2005
Posts: 600 ubergeek User rank is Private First Class (20 - 50 Reputation Level)ubergeek User rank is Private First Class (20 - 50 Reputation Level) 
Time spent in forums: 2 Days 22 h 40 m 27 sec
Reputation Power: 4
Send a message via AIM to ubergeek
uh...huh. And we're just supposed to do your homework for you. If you show us what you've tried so far, and tell us where you're having trouble, we can help. But we won't just do your assignment for you; that's cheating, you don't learn anything, and what's the point?

Reply With Quote
  #3  
Old March 18th, 2006, 10:43 PM
jandali jandali is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Feb 2006
Posts: 18 jandali User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 7 h 6 m 23 sec
Reputation Power: 0
Quote:
Originally Posted by ubergeek
uh...huh. And we're just supposed to do your homework for you. If you show us what you've tried so far, and tell us where you're having trouble, we can help. But we won't just do your assignment for you; that's cheating, you don't learn anything, and what's the point?

lol, i will write the code but thing is that i don't understand the logic what u r suppose to do.

Reply With Quote
  #4  
Old March 18th, 2006, 10:49 PM
ubergeek ubergeek is offline
Contributing User
Dev Articles Novice (500 - 999 posts)
 
Join Date: Jan 2005
Posts: 600 ubergeek User rank is Private First Class (20 - 50 Reputation Level)ubergeek User rank is Private First Class (20 - 50 Reputation Level) 
Time spent in forums: 2 Days 22 h 40 m 27 sec
Reputation Power: 4
Send a message via AIM to ubergeek
Well, we can help you with the logic, but we need more information than you gave. What's in treenode.h? What is a studentNode? What are the implementations of the functions besides the ones you asked for help with?

Reply With Quote
  #5  
Old March 18th, 2006, 10:53 PM
jandali jandali is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Feb 2006
Posts: 18 jandali User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 7 h 6 m 23 sec
Reputation Power: 0
it is there

Reply With Quote
  #6  
Old March 18th, 2006, 10:54 PM
jandali jandali is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Feb 2006
Posts: 18 jandali User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 7 h 6 m 23 sec
Reputation Power: 0
Quote:
Originally Posted by jandali
Code:
Original - Code
    #ifndef _TREENODE_H #define _TREENODE_H #include "studentRec.h" class treeNode { private:     studentRecord *data;         treeNode *left, *right; public:     // the default constructor     treeNode(studentRecord* _student);     // the destructor     ~treeNode();     // sets the next child of the treeNode.     void setLeftChild(treeNode *newLeft);         // sets the right child of the treeNode         void setRightChild(treeNode *newRight);     // gets the next child of the treeNode.         treeNode *getLeftChild();         // gets the right child of the treeNode         treeNode *getRightChild();     // returns a pointer to the student record the treeNode contains.     studentRecord* getStudentRec(); }; //treeNode #endif




Code:
Original - Code
    #ifndef _STUDENTREC_H #define _STUDENTREC_H #include <string> using std::string; #define NUM_OF_MARKS 5   // indexed 0-4 class studentRecord { private:     unsigned int studentNumber;     string _firstName;         string _lastName;     unsigned int marks[NUM_OF_MARKS]; public:     // the default constructor     studentRecord();     // the destructor     ~studentRecord();      // sets the student number of the record to studentNum.     void setStudentNumber(unsigned int studentNum);     // sets the student first name to firstName.     void setFirstName(string firstName);     // sets the student last name to lastName.     void setLastName(string lastName);     // sets the mark at index "index" of the student record to mark.     // the method assumes the index is in 0-4 range, and     // the mark is in 0-100 range.     void setMark(int index, unsigned int mark);     // returns the student number.     unsigned int getStudentNumber();     // returns the first name of the student record.     string getFirstName();     // returns the last name of the student record.     string getLastName();     // returns the mark at index "index" of the student record.     // it assumes the index is in 0-4 range.     unsigned int getMark(int index);     // prints the student record to the standard output in the format     // specified in the assignment specifications.     void print(); }; //studentRecord #endif

Reply With Quote
  #7  
Old March 19th, 2006, 06:35 AM
Cirus Cirus is offline
Contributing User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Mar 2005
Posts: 276 Cirus User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 Day 11 h 48 m 58 sec
Reputation Power: 4
What do you want to know from the posted code?Do you want to write insert ,retrieve and remove functions?

If you need logic then it is clear cut what these functions do.It is just a link list implementation. If you are facing troubles in implementing these functions show us your try first . Only then we can help you.

Reply With Quote
Reply

Viewing: Dev Articles Community ForumsProgrammingC/C++ Help > Help needed


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump



 Free IT White Papers!
 
How to Present Effectively Online
This white paper offers practical and actionable advice on the key steps that any presenter should consider as they plan and execute a Webinar or online meeting.

Request Your Free Technology Downloads!
 
Open Source Security Myths
Open Source Software (OSS) is computer software whose source code is available to the general public with relaxed or non-existent intellectual property restrictions (or arrangement such as the public domain), and is usually developed with the input of many contributors.

Request Your Free Technology Downloads!
 
Power and Cooling Capacity Management for Data Centers
This paper describes the principles for achieving power and cooling capacity management.

Request Your Free Technology Downloads!
 
Scalable, Fault-Tolerant NAS for Oracle - The Next Generation
For several years NAS has been evolving as a storage alternative for Oracle databases, and for good reason: NAS is quite often the simplest, most cost-effective storage approach for Oracle. Learn about the benefits that HP's approach to scalable NAS brings to Oracle environments in this comprehensive white paper.

Request Your Free Technology Downloads!
 
Understanding Web Application Security Challenges
This white paper discusses many common threats and preventive measures for Web application security, and explains what you can do to help protect your organization.

Request Your Free Technology Downloads!
 

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2009 by Developer Shed. All rights reserved. DS Cluster 6 hosted by Hostway
Stay green...Green IT