Ask Question, Ask an Expert

+61-413 786 465

info@mywordsolution.com

Ask Computer Engineering Expert

Project specification: In this project you are going to implement a word search engine using C++. The search engine would help users to count number of occurrence of a word among given set of text files.

Input specification: The program takes as an input a set of files, containing of multiple words. Words can appear multiple times in a single file or in different files. The input files should be stored in a dedicated directory and loaded in memory upon program execution.

Program functionality:Upon execution, the program should load all the words from the input files in the memory. The program should run until the user explicitly specifies "exit". The following functionality should be supported:

1. Count how many times a user specified word appears in the files.

2. Display the name of input files and corresponding number of occurrences of the specified word.

Upon execution of you program, you should specify as input parameter the path to a directory containing the input files. If executed (which somesone enters an input like "cat"), the program should return the name of files that contain the word "cat" and the number of occurrences of the word in each file

First, you need to implement a class for an abstract data type, in which you are going to store files in memory.

You need to declare a class Word that would store a word and a pointer to the beginning of a linked list and another class File that would store a file-name and number of times that the word occurred in this file. The process of "loading files in the memory" consists of

(i) creating an object of type Word for each new word that occurs in the set of input files,

(ii) appending this object to a linked list (e.g. the green linked list from the picture),

(iii) creating an object File for each occurrence of the word in a file and

(iv) updating the corresponding (blue) linked list with the object File.

Once you have the files loaded in such structure, the searching would be as easy as finding the queried word in the "green" linked list and tracing in which files does it occur by going over the corresponding "blue" linked list.

To start gaining experience in how to structure your C++ projects, you are required to split the different aspects of this program and implement them in separate files. Then you will have to put them all back together to achieve the program functionality. You will need to create several .h and .cpp files for this project. We will help guiding you through this process.

First you need to identify the important object-types and methods you will need for your implementation. In this project, your main object types are going to be class Word and class File. Go ahead and create a file called itemtype.h and declare class File in it.

Then create another file called itemtype.cpp and define your class File in it. These two files are going to be related to objects from the "blue" lists on the picture. The next step is to implement the functionality for creating the "blue" lists. For this purpose, you need to create two more files - list.h and list.cpp. In list.h declare all the methods needed for building a "blue" list and in list.cpp define these methods.

Next, you need to implement the functionality related to objects like these in the "green" list. Create two more files - word.h and word.cpp, declare class Word and all methods to this class in word.h and define them in word.cpp. Now what's left is to put it all together by writing a main function that utilizes both file and word. To do so, create wordsearch.h and wordsearch.cpp, declare your main function in wordsearch.h and define it in wordsearch.cpp.

So all in all you will need eight files: wordsearch.h, wordsearch.cpp, itemtype.h, itemtype.cpp, list.h, list.cpp, word.h, word.cpp.

You need to submit 8 files. Eight of these are the implementation of your project assignment, namely wordsearch.h, wordsearch.cpp, itemtype.h, itemtype.cpp, list.h, list.cpp, word.h, word.cpp.

And yeah that's about it.

Computer Engineering, Engineering

  • Category:- Computer Engineering
  • Reference No.:- M93097657

Have any Question?


Related Questions in Computer Engineering

Reading the biographybook where the body meets memory by

Reading the Biography Book : "Where the Body Meets Memory" by David Mura Questions: When David Mura was growing up, he tried very hard to reject his Japanese heritage. Find examples in Chapter 2 "All American Boy," and t ...

In a nationwide poll of 1500 randomly selected us residents

In a nationwide poll of 1500 randomly selected U.S. residents, 77% said they liked pizza. In a poll of 1500 randomly selected U.S residents one month later, 75% responded they liked pizza. a. Does the polling evidence su ...

Would you help me by giving me some helpful tips about how

Would you help me by giving me some helpful tips about how to study basic C programming in days?

Garber and skinner suggest that the large per capital

Garber and Skinner suggest that the large per capital health spending in the US (and relatively low returns to health) are due to productive and allocative inefficiencies. Which inefficiency (if either) do you think char ...

Question suppose an instruction can be carried out in 3

Question : Suppose an instruction can be carried out in 3 stages, the stages taking 3 ns, 7 ns, and 10 ns, respectively. (a) What is the maximum execution rate without pipelining? (b) What speedup is possible with pipeli ...

Question please research a professional white paper

Question: Please research a professional white paper (academic) PDF format and with in the last two years that is relevant to this class and outline a 750 word document in APA format include the following: cover sheet, i ...

Reading the biographybook where the body meets memory by

Reading the Biography Book : "Where the Body Meets Memory" by David Mura Questions: On page 62 to 66, David Mura talked about an incident when he was in fifth grade. A bully called Mike Wrangel was trying to beat up anot ...

Tasks1 identify possible actors and use cases involved in

Tasks: 1. Identify possible actors and use cases involved in Personal Trainer's operations. 2. Create an object relationship diagram for the Personal Trainer information system. 3. Create a use case diagram for the syste ...

Question in relational algebra is the set difference

Question : In relational algebra: is the set difference commutative or not and Why? What is the difference between multivalued and composite attribute? Explain with Example.

Question suppose that as a dba you are tasked with

Question : Suppose that as a DBA, you are tasked with installing a new database management system in your organization. Would you choose the default system parameters when installing the system software? Explain and supp ...

  • 4,153,160 Questions Asked
  • 13,132 Experts
  • 2,558,936 Questions Answered

Ask Experts for help!!

Looking for Assignment Help?

Start excelling in your Courses, Get help with Assignment

Write us your full requirement for evaluation and you will receive response within 20 minutes turnaround time.

Ask Now Help with Problems, Get a Best Answer

Why might a bank avoid the use of interest rate swaps even

Why might a bank avoid the use of interest rate swaps, even when the institution is exposed to significant interest rate

Describe the difference between zero coupon bonds and

Describe the difference between zero coupon bonds and coupon bonds. Under what conditions will a coupon bond sell at a p

Compute the present value of an annuity of 880 per year

Compute the present value of an annuity of $ 880 per year for 16 years, given a discount rate of 6 percent per annum. As

Compute the present value of an 1150 payment made in ten

Compute the present value of an $1,150 payment made in ten years when the discount rate is 12 percent. (Do not round int

Compute the present value of an annuity of 699 per year

Compute the present value of an annuity of $ 699 per year for 19 years, given a discount rate of 6 percent per annum. As