Word Find A popular diversion in the United States, “word find” (or “word search”) puzzles ask the player to find each of a given set of words in a square table filled with single letters. A word can read horizontally (left or right), vertically (up or down), or along a 45 degree diagonal (in any of the four directions) formed by consecutively adjacent cells of the table; it may wrap around the table’s boundaries, but it must read in the same direction with no zigzagging. The same cell of the table may be used in different words, but, in a given word, the same cell may be used no more than once. Write a computer program in C++ for solving this puzzle.
In: Computer Science
Word Find A popular diversion in the United States, “word find” (or “word search”) puzzles ask the player to find each of a given set of words in a square table filled with single letters. A word can read horizontally (left or right), vertically (up or down), or along a 45 degree diagonal (in any of the four directions) formed by consecutively adjacent cells of the table; it may wrap around the table’s boundaries, but it must read in the same direction with no zigzagging. The same cell of the table may be used in different words, but, in a given word, the same cell may be used no more than once. Write a computer program for solving this puzzle.
In: Computer Science
Word Building
Build the following terms using word parts.
|
word part for pus |
________________________ |
|
word part for uterus |
________________________ |
|
term for pus in the uterus |
________________________ |
|
word part for near |
________________________ |
|
word part for ovary |
________________________ |
|
term for near the ovary |
________________________ |
|
word part for urinary |
________________________ |
|
word part for reproductive system |
________________________ |
|
word part for pertaining to |
________________________ |
|
term for pertaining to the urinary and reproductive systems |
________________________ |
|
word part for milk |
________________________ |
|
word part for producing |
________________________ |
|
word part for pertaining to |
________________________ |
|
term for capable of stimulating milk production |
________________________ |
|
word part for uterus |
________________________ |
|
word part for surgical removal |
________________________ |
|
term for surgical removal of the uterus |
________________________ |
In: Anatomy and Physiology
Write a Python program in a file called consonants.py, to solve the following problem using a nested loop. For each input word, replace each consonant in the word with a question mark (?). Your program should print the original word and a count of the number of consonants replaced. Assume that the number of words to be processed is not known, hence a sentinel value (maybe "zzz") should be used. Sample input/output:
Please enter a word or zzz to quit: Dramatics
The original word is: dramatics
The word without consonants is: ??a?a?i??
The number of consonants in the word are: 6
Please enter another word or zzz to quit: latchstring
The original word is: latchstring
The word without consonants is: ?a??????i??
The number of consonants in the word are: 9
Please enter another word or zzz to quit: YELLOW
The original word is: yellow
The word without consonants is: ?e??o?
The number of consonants in the word are: 4
Please enter another word or zzz to quit: zZz
In: Computer Science
A machine prints a word and the number of letters in this word is a Poisson distributed random variable with parameter λ (so it could possibly have zero letters). However, each letter in the word is printed incorrectly with probability 2/3 independently of all other letters. Compute the expectation and the variance of the number of incorrect letters in the word that the machine prints.
In: Statistics and Probability
A word is said to be “abecedarian” if the letters in the word appear in alphabetical order. For example, the following are all six-letter English abecedarian words:
abdest, acknow, acorsy, adempt, adipsy, agnosy, befist,
behint,
beknow, bijoux, biopsy, cestuy, chintz, deflux, dehors,
dehort,
deinos, diluvy, dimpsy
Write a method called isAbecedarian that takes a String and returns a boolean indicating whether the word is abecedarian.
In: Computer Science
code in. c++
void seen );
If there is already a Word object in the Words list, then the
number of occurrences for this word is incremented. If there is no
Word object for this word already, create a new word object with
occurrence =1, and insert this object into the list of Word
objects.
getNextWord();
Returns the next word of the list and sets the currentItem pointer
to the next Word. This may return an empty string, “”, if the
pointer is NULL.
StackNode* findWord(std::string);
Returns a pointer to some Word in the list. Return NULL if not
found.
Write a driver to do the following:
Create a Words object. This is a linked list of Word objects.
Open an input file full of mixed words. Read each word. For each word in the input file, call the seen method for this word. The seen method takes a string argument. For example, the word ‘cat’ was just read in. Call myWords.seen(“cat”).
After processing all of the words in the file, close the file.
Last, print out the statistics of the file to the console.
Include:
For every word in the Words object, print the word and the number
of occurrences. The total number of Words in the file.
complete
#ifndef WORD_H_
#define WORD_H_
#include <string>;
class Word
{
private:
std::string word;
int occurrences;
public:
Word(std::string w); //word = w and occurrences = 1
std::string getWord() const; //return the stored word
int getOccurrences() const;
void increment(); //increment the occurrences value
};
#endif
complete
#ifndef WORDS_H_
#define WORDS_H_
#include <string>;
#include "Word.h";
class Words
{
private:
struct StackNode
{
Word word;
StackNode *next;
};
StackNode *top;
StackNode *currentItem;
StackNode* findWord(std::string); //Returns a pointer to some Word in the list
// return NULL if not found
public:
Words() // Create an empty list of Word objects
{ top = NULL;
resetNextWord();
}
void remove(std::string); //remove a word object, if it is in the list
bool find(std::string) const; //if the word, as a string, is in the list, return true. else false
void seen(std::string); //pass in a word, as a string, that has been seen.
// If this word is not in the list, insert it with
// the number of occurrences = 1.
// If this word is in the list, increment the
// occurrences for this word.
int getOccurrences(std::string) const; //return the value of occurrences
int getLength() const; // returns the length of the list. NOT STORED
std::string getNextWord(); // returns the next word of the list and sets
// the currentItem pointer to the next Word
void resetNextWord(); //resets the currentItem pointer to top.
bool isEmpty() const;
};
#endifIn: Computer Science
Write a program that asks the user to enter a bunch of words until they type the word “quit”. Count how many words had 5 letters or more.
Sample program
Enter a word: nothing
Enter a word: stop
Enter a word: word
Enter a word: program
Enter a word: supercalifragilisticexpialidocious
Enter a word: quit
You entered 3 words that were longer than 5 letters.
In: Computer Science
(C LANGUAGE) Write a function called upperLower that inputs a line of text into char array s[100]. Output the line in uppercase letters and in lowercase letters
This is what I have so far:
void * upperLower (const char * s) {
char *word[sizeof(s)];
for(int i = 0; i < sizeof(s); i++){
*word[i] = s[i];
}
word = strtok(word, " ");
int counter = 0;
while(word != NULL){
if(counter % 2 == 0){
word[counter] = toupper(word);
printf("%s ", word);
}
else{
word[counter] = tolower(word);
printf("%s ", word);
}
counter++;
word = strtok(NULL, " ");
}
}
The method cannot be changed. Must use void * upperLower (const char * s) {
The output should be like THIS is A test
In: Computer Science
Write a function checkvertical(board, word, row, col), which returns True if the word word can be added to the board starting at position board[row][col] and going down. The restrictions are (1) it has to fit entirely on the board, (2) it has to intersect and match with one or more non-blank letters on the board, and (3) it cannot change any letters on the board, other than blanks (that is, overlapping mismatches are not allowed).
My program isn't working :( Can anyone fix the program?
My program:
def checkvertical(board, word, row, col):
if len(word) > 20 - row:
return False
matchesoneletter = False
for k in range(len(word)):
wordletter = word[k]
boardletter = board[row + k][col]
if wordletter == boardletter:
matchesoneletter = True
if boardletter == blank:
continue
elif boardletter != wordletter:
return False
return matchesoneletter
In: Computer Science