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

  Solve the javascript program

solve the javascript program.

  Complete handover of change management

How much control will you expect the Project Manager to have over planned changes, in projects where work has been extensively outsourced to external contractors? Full or partial control, or a complete handover of change management responsibility ..

  Write a paper of important suggestions from the plan

Search the Internet for IT governance planning. Select a specific governance plan that exists at a company or a plan framework from an organization.

  What is meant by the functional decomposition

Describe what is meant by the functional decomposition of a Boolean function of n variables and discuss procedures for decomposing Boolean functions.

  Define computer hardware - financial planning

In this recommendation, selecting only two kinds of computers (desktop, laptop, notebook or handheld computers) and other hardware components.

  Produce a thresholded binary image

E27: Computer Vision Spring 2016 - PROJECT 1. Thresholding. Your system will produce a thresholded binary image where the non-zero pixels correspond to objects of interest (foreground), and the zero pixels correspond to background. You will need t..

  Boolean expressions to work out your logic

Write a program that determines, for each of the five hands of the game, whether or not then Ace is played. Use the truth tables and Boolean expressions to work out your logic for this.

  As the text describes there are seven 7 steps in the

q1. as the text explains there are seven 7 steps in the program development cycle. identify which of the steps that you

  Determining the compression algorithms

Natural-language text in ASCII can be compressed by at least 50% using various compression algorithms. Using this knowledge, what is the steganographic carrying capaci- ty for ASCII text (in bytes) of a 1600 ´ 1200 image stored using the low-order..

  Mips single-cycle datapath processor

An instruction is being executed on the MIPS single-cycle datapath processor. Which class of instruction is being executed over the processor? b) Will you specify which instruction is being executing?

  Latter discloses the password length

Not having the computer echo the password is safer than having it echo an asterisk for each character typed, since the latter discloses the password length to anyone nearby who can see the screen.

  List the possible formats for presenting menus to a user arc

List the possible formats for presenting menus to a user arc' explain under what circumstances each might be appropriate.

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