GIDForums  

Go Back   GIDForums > Computer Programming Forums > C++ Forum
User Name
Password
Register FAQ Members List Calendar Search Today's Posts Mark Forums Read

 
 
Thread Tools Search this Thread Rate Thread
  #1  
Old 16-Jan-2004, 03:29
eye eye is offline
New Member
 
Join Date: Jan 2004
Posts: 3
eye is on a distinguished road

Programs that need expert


Can You guys help me on this???This is very hard
Can use vector, pointer, class.

The first program is to read a text file that contains a list of file names of documents that we need to index. The words that need to be indexed are all words excluding the words found in the attached file (“NOINDEX.TXT”).This index will keep track of the file name, line number and position of the word in each of the indexed documents. Index must be sorted in ascending order to enable a recursive binary search algorithm. The index will store in an index file.

The second program is use to read the index from the file, and then construct the structure on the next page again. Then as a search engine to allocate any given word and display the file name, the line that contains the word and the word itself highlighted. This search engine must use a recursive binary search algorithm and a recursive quick sort.
  #2  
Old 16-Jan-2004, 05:39
Garth Farley Garth Farley is offline
Invalid Email Address
 
Join Date: May 2002
Location: Ireland
Posts: 638
Garth Farley is a jewel in the roughGarth Farley is a jewel in the roughGarth Farley is a jewel in the rough
This looks like a question straight from a teacher/lecturer! Forgive me if this sounds rude, but do you honestly expect someone to explain the whole program to you? I'd much prefer if you looked at this yourself, came up with some code, then post and ask what's wrong.

You're asking about C++, yes? You'll need a class which holds each line of information, (word, filename, linenumber, position). You'll use the vector class to store a list of these, probably within a class Index, which will do checking of input.

Open the noindex file, read it into a vector of strings, within Index. The Index class with have a function which takes each filename. The file will be open, each line will be read individually (by getline) into a stringstream (can you use this class?), then each word read from the stream (noting it's position), is checked against the noidex vector. If it's there, you log the info in the Index!

I'm no expert, but that's what I'd do.
GF
  #3  
Old 16-Jan-2004, 05:46
eye eye is offline
New Member
 
Join Date: Jan 2004
Posts: 3
eye is on a distinguished road

First Year Student


Quote:
Originally Posted by Garth Farley
This looks like a question straight from a teacher/lecturer! Forgive me if this sounds rude, but do you honestly expect someone to explain the whole program to you? I'd much prefer if you looked at this yourself, came up with some code, then post and ask what's wrong.

You're asking about C++, yes? You'll need a class which holds each line of information, (word, filename, linenumber, position). You'll use the vector class to store a list of these, probably within a class Index, which will do checking of input.

Open the noindex file, read it into a vector of strings, within Index. The Index class with have a function which takes each filename. The file will be open, each line will be read individually (by getline) into a stringstream (can you use this class?), then each word read from the stream (noting it's position), is checked against the noidex vector. If it's there, you log the info in the Index!

I'm no expert, but that's what I'd do.
GF

Yes this thing is come from my lecturer. He expect us to do this without teaching us how to do! I am first year student, just learning how to program but never expect this kind of question coming up. The due date for this Q is this coming monday.
You should know programming need idea to doing it, but now I dont even know what should I do. I really hope someone can help me do this. I am not trying to escape for doing this question.I am very very presure about this. I hope you can help me up, then I will look the code and try to understand it.
Thanks.
  #4  
Old 16-Jan-2004, 06:02
Garth Farley Garth Farley is offline
Invalid Email Address
 
Join Date: May 2002
Location: Ireland
Posts: 638
Garth Farley is a jewel in the roughGarth Farley is a jewel in the roughGarth Farley is a jewel in the rough
This is a very tough assignment for first years, after just only 1 term. I suggest you talk to your lecturer, ask his/her help. Have you been given long to do this, or has this been left on the backburner?

Get a book on C++ from your library. Swot up on vectors, and this class lark. Break this question up into smal chunks that you can manage. I've not got time to write this out for you! I'd love to, but I'm in your shoes with stuff to hand in soon. You've got to be proactive in this, your lecturer is obliged to help you! Request an extension! Anything to give yourself more time, and reduce the pressure.

I'm being a prick, but you gotta figure out University teaching style, it's a big differ from school. You do a lot the work yourself, but you've to stand up for yourself when necessary.

Any questions I'll be glad to answer.
GF
 
 

Recent GIDBlogStupid Management Policies by crystalattice

Thread Tools Search this Thread
Search this Thread:

Advanced Search
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
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Google Adsense could mean death to affilliate programs jrobbio AdSense Forum 12 11-Feb-2006 16:51
Using datafeeds for affiliate programs Div MySQL / PHP Forum 23 05-Mar-2004 23:37
premade forums and other premade php programs invaderz MySQL / PHP Forum 1 06-Jul-2003 03:10

Network Sites: GIDNetwork · GIDWebHosts · GIDSearch · Learning Journal by J de Silva, The

All times are GMT -6. The time now is 05:43.


vBulletin, Copyright © 2000 - 2008, Jelsoft Enterprises Ltd.