Create a crossword puzzle you need to identify letters

Assignment Help Computer Engineering
Reference no: EM132100901

Please Use C++ Language.

For this assignment, you will write a program that forms the basis of a crossword puzzle generator. In order to create a crossword puzzle you need to identify letters that are common to one or more words. This program helps you generate crossword puzzles by identifying letters that are common to several words and string them in an intermediate data structure.

Using intermediate data structures is one way to simplify your coding. You create a data structure that organizes your input so the final output is easier to create.

Your CrosswordGenerator program will open a file containing a list of words. To prepare for crossword puzzle generation your code should implement the following pseudo code:

Open a file named wordlist.txt

Determine the number of words (N) in the file.

Create an array of that size called wordArray[];

Read all the words from the file into an array called wordArray[N].

Sort the array of words by length in descending order

Start at the beginning of the array (the longest word) and examine the word

Find all other words in the array that can intersect the current word

Two words can intersect if they share a letter.

Write a function called String sharedLetters(String S1, String S2)

Implement sharedLetters(S1,S2) that will return a string containing letters shared by the two parameter strings S1 and S2.

If no letters are shared between S1 and S2 sharedLetters() should return the empty string "".

sharedLetters(S1,S2) should ignore case; capital and lower case letters are considered equal

Create a two dimensional array of Strings wordsIntersect[N][N] where each dimension N is the size of wordArray.

Iterate over wordArray comparing distinct words. Do not compare a word to itself.

If wordArray[i] shares any letters with wordArray[j] place the result of sharedLetters(wordArray[i],wordArray[j]) into wordsIntersect[i][j]

Non-alphabetic characters should be ignored.

Upper and lower case letters should be equivalent. Your program should not treat them as distinct tokens.

The order of shared letters is not a consideration for this program.

Write the contents of the wordsIntersect array to a Comma Separated Values (CSV) text file named wordsIntersect.csv in row-major form: row,col,value.

In the example below, there is an entry in wordsIntersect[12][33] which contains the string "tci". There would also be a line in wordsIntersect.csv that contains 12,33,tci -- there are no quotes around the letters and the line ends after the letter 'i'. Given that wordsIntersect[12][78] will contains "" there would be a line in the file containing: 12,78, where there is an end of line after the last comma.

N.B.

Example of what sharedLetters() output.

SharedLetters(transaction,dictum) returns "tci"

SharedLetters(Transaction,kudzu) returns ""

If "transaction" is stored in wordArray[12] and "dictum" is stored in wordArray[33] then wordsIntersect[12][33] will contain "tci"

if "kudzu" is stored in wordArray[78] then wordsIntersect[12][78] will contain ""

Reference no: EM132100901

Questions Cloud

Create an additional array called less_array : Declare a single dimensional array of 65 characters. Convert each character into an integer and store it in a linked list.
True of uncontrolled market data : Which of the following is true of uncontrolled market data? Uncontrolled market data reflects changes in multiple factors at the same time.
How to give the sphere exactly equal but opposite charges : You are given two metal spheres on portable insulating stands, glass rod, and a piece of silk. Explain how to give the sphere exactly equal but opposite charges
Total processing time required machine type to meet demand : Compute the total processing time required machine type to meet demand, how many of each machine type would needed and the resulting total purchasing cost
Create a crossword puzzle you need to identify letters : Create an array of that size called wordArray[]; Read all the words from the file into an array called wordArray[N].
Social media consumer information to benefit their company : Discuss how you think marketing departments can utilize social media consumer information to benefit their company
What is the electric flux through the top surface : A 10 nC point charge is at the center of a 4m x 4m x 4m cube. What is the electric flux through the top surface of the cube?
Find the angles of the reflected and transmitted beams : If the beam makes a 75 degree angle of incidence with respect to a normal to the water surface, is it reflected, transmitted, or both?
Create an inheritance hierarchy containing base class : Create an inheritance hierarchy containing base class Account and derived class Savings-Account.

Reviews

Write a Review

Computer Engineering Questions & Answers

  Mathematics in computing

Binary search tree, and postorder and preorder traversal Determine the shortest path in Graph

  Ict governance

ICT is defined as the term of Information and communication technologies, it is diverse set of technical tools and resources used by the government agencies to communicate and produce, circulate, store, and manage all information.

  Implementation of memory management

Assignment covers the following eight topics and explore the implementation of memory management, processes and threads.

  Realize business and organizational data storage

Realize business and organizational data storage and fast access times are much more important than they have ever been. Compare and contrast magnetic tapes, magnetic disks, optical discs

  What is the protocol overhead

What are the advantages of using a compiled language over an interpreted one? Under what circumstances would you select to use an interpreted language?

  Implementation of memory management

Paper describes about memory management. How memory is used in executing programs and its critical support for applications.

  Define open and closed loop control systems

Define open and closed loop cotrol systems.Explain difference between time varying and time invariant control system wth suitable example.

  Prepare a proposal to deploy windows server

Prepare a proposal to deploy Windows Server onto an existing network based on the provided scenario.

  Security policy document project

Analyze security requirements and develop a security policy

  Write a procedure that produces independent stack objects

Write a procedure (make-stack) that produces independent stack objects, using a message-passing style, e.g.

  Define a suitable functional unit

Define a suitable functional unit for a comparative study between two different types of paint.

  Calculate yield to maturity and bond prices

Calculate yield to maturity (YTM) and bond prices

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd