Questions
Write a spell checking program (java) which uses a dictionary of words (input by the user...

Write a spell checking program (java) which uses a dictionary of words (input by the user as a string) to find misspelled words in a second string, the test string. Your program should prompt the user for the input string and the dictionary string. A valid dictionary string contains an alphabetized list of words.

Functional requirements:

  1. For each word in the input string, your program should search the dictionary string for the given word. If the word is not in the dictionary, you program should print the message "Unknown word found" to standard output.
  2. After traversing the entire input string, your program should print a message describing the total number of misspelled words in the string.
  3. A dictionary string may contain words in uppercase, lowercase, or a mixture of both. The test string may also combine upper and lower case letters. You program should recognize words regardless of case. So if "dog" is in the dictionary string, the word "dOG" should be recognized as a valid word. Similarly, if "CaT" is in the dictionary string, the word "cat" she be recognized as a valid word.
  4. Within a string, a word is a white-space delimited string of characters. So the last word in "Hello world!" is "world!".

In: Computer Science

Computer Architecture 1. Define what a "word" is in computer architecture: The size (number of bits)...

Computer Architecture

1. Define what a "word" is in computer architecture:

  1. The size (number of bits) of the address
  2. The total number of bits of an instruction (e.g. 16 bits)
  3. Word and width are synonymous.
  4. A word is the contents of a memory register.

2. What is the difference between a register’s width and a register’s address? (choose all that apply - there may be more than one correct answer)

  1. They are both the same!
  2. Address is the same for all registers, width is unique for each register.
  3. Width is the amount of data a single register holds, address is the location of the register within a larger chip.
  4. The address bits of a register is a logarithm of its width.

3. Which of the following is NOT implemented by the Program Counter?

  1. Set the counter to 0.
  2. Increase the counter by 1.
  3. Decrease the counter by 1.
  4. Set the counter to any input value.

4. What is the relationship between the size of the address (number of bits) and the word size for memory registers?

  1. address bits = 2^(word size)
  2. address bits = word size ^ 2
  3. address bits = word size
  4. address bits = log2(word size)
  5. address bits = (word size) / 2

In: Computer Science

Write a Java program that prompts the user to input a word (String). The program must...

Write a Java program that prompts the user to input a word (String).

The program must print the reversed word with all consecutive duplicate characters removed.

The program must contain the following classes: -

The StackX class (you can use the Java Stack class). - The Reverse class which must contain a private data field called “word” of type string, a constructor, and a void method called revNoDup(). The revNoDup() method must reverse the word and remove the consecutive duplicate characters. The revNoDup() method must print the new word (i.e. reversed with consecutive duplicate characters removed). The revNoDup() method must use a Stack to reverse the word and remove the duplicate characters. - The Test class which must contain the main() method. In the main() method, you must prompt the user to input a word (String), create an object from class Reverse, and call the revNoDup() method.

Here is a sample run:

Enter a word:

Tomorrow

woromoT

In: Computer Science

17) Refer the previous question: The following table gives the common disorders, problems and complaints associated...

17) Refer the previous question: The following table gives the common disorders, problems and complaints associated with each body system and its components relevant to the nursing care you might provide for your clients in the Australian health care system. Complete the following table with regard to its definition, pathophysiology, signs and impact of specific health procedures(in 10-20 words each). DISEASES AFFECTING THE MUSCULOSKELETAL SYSTEM Gout Gout

17.1) Definition Minimum word required : 10 Word count

17.2) Briefly outline the pathophysiology Minimum word required : 10 Word count

17.3) List four specific signs Minimum word required : 10 Word count

17.4) Impact of allopurinol on patients with gout. Minimum word required : 10

In: Nursing

Pig Latin is a language constructed by transforming English words. The following rules are used to...

Pig Latin is a language constructed by transforming English words. The following rules are used to translate English into Pig Latin:

*If the word begins with a consonant, then all consonants at the beginning of the word, up to the first vowel are removed then added to the end of the word, followed by “ay”. For example, “computer” becomes “omputercay” and “think” becomes “inkthay”.

*If the word begins with a vowel, then “way” is added to the end of the word. For example, “algorithm” becomes “algorithmway” and “office” becomes “officeway”.

*If the word ends in a punctuation mark, then the punctuation mark should remain at the end of the word after the transformation has been performed. For example, “science!” should become “iencescay!”. You can assume that the punctuation mark is only a single character. The program reads a line of text from the user and translates it into Pig Latin and displays the result.

This is in python.

In: Computer Science

Name your c++ file Word_LastNameFirstName.cpp. Create a struct that has a word and the length of...

Name your c++ file Word_LastNameFirstName.cpp. Create a struct that has a word and the length of the word. Next, use the struct to store the word read from a text file call “word.txt” and the length of the word. Print out the word x number of times based on the length of the word as shown below. Also, print a statement with the length and determine if the string length has an odd number or even number of characters. You need to create your own text file and place in the proper folder.

For instance, if the file contains the string "Program", its length is 7, 7 is a odd number and it will be printed 7 times like the below. Print to the console like below

OUTPUT :     

Program

Program

Program

Program

Program

Program

Program

The word "Program" has a length of 7 and has an odd number of character

In: Computer Science

Create a Visual Studio console project named exercise101. The main() function should prompt for the name...

Create a Visual Studio console project named exercise101. The main() function should prompt for the name of a text file located in the same directory as exercise101.cpp, and search for a word in the text file as follows:

Enter text file name:

Enter search word:

The program should print the number of occurrences of the word in the file:

occurrences of were found in If the file could not be opened then display:

File not found Use Stream file I/O as a guide to opening and reading a stream input file.

You should read the file word by word, where a word is a set of characters preceded and followed by white space including newlines.

Test you program by searching for the word "government" in the usdeclar.txt file available in Files / Source code / Exercise 10.1 Upload your exercise101.cpp source file to Canvas.

In: Computer Science

Write a C program that does the following: 1) Asks the user to enter an integer...

Write a C program that does the following:
1) Asks the user to enter an integer N
2) Asks the user to enter three words with at least N letters and at most 20 letters
3) Prints the first N letters from the first word
4) Prints the last N letters from the second word
5) Prints all letters in the odd position in the third word

Output:
Please enter an integer N: 3
Please enter a word with at least 3 and at most 20 letters: Germany
Please enter a second word with at least 3 and at most 20 letters: China
Please enter a third word with at least 3 and at most 20 letters: Argentina
Germany starts with Ger
China ends with ina
Odd letters in the third word are: A g n i a

In: Computer Science

In this assignment you will be implementing a function that will find all single-word anagrams given...

In this assignment you will be implementing a function that will find all single-word anagrams given a single word and a list of all words. In the starter code you will the starting source file anagram.cpp and the list of words wordlist.txt. You will need to implement the anagram() function which takes a string for the word to find anagrams of as the first parameter and a vector of strings containing a list of all words as the second parameter. The return value of anagram() will be a vector of strings containing all anagrams (including the parameter word if it is an actual word). There is a main function that will test the anagram() function as well as an already-implemented function loadWordlist() which will read in words from the specified file with the format by string-type parameter and return these words in a vector of strings. The anagram() function will take a word (string) and a wordlist of all words (vector of strings) and builds a dictionary/map where the key is a specific amount of times each letter occurs in a word and the associated value is a vector of strings containing all words using those letters (anagrams). You may either modify the Stringset class to be a dictionary (holding a key:value pair as opposed to just a key) or use the STL unordered_map structure. The main() function provided will test the anagram() function with a word the user types in using the words stored from wordlist.txt in wordlist, for example if the user types in steak, anagrams=anagram("steak",wordlist); will run and if implemented correctly the following contents of anagrams will be displayed:

skate stake steak takes teaks

Submit anagram.cpp with the implemented anagram() function. You are free to implement any helper functions in anagram.cpp.

Anagram.cpp:
#include
#include
#include
#include

using namespace std;

vector loadWordlist(string filename);
vector anagram(string word, vector wordlist);

int main()
{
vector words;
vector anagrams;
string inputWord;
words=loadWordlist("wordlist.txt");
cout << "Find single-word anagrams for the following word: ";
cin >> inputWord;
anagrams = anagram(inputWord, words);
for (int i=0; i {
cout << anagrams[i] << endl;
}
return 0;
}

vector loadWordlist(string filename)
{
vector words;
ifstream inFile;
string word;
inFile.open(filename);
if(inFile.is_open())
{
while(getline(inFile,word))
{
if(word.length() > 0)
{
words.push_back(word);
}
}
inFile.close();
}
return words;
}
vector anagram(string word, vector wordlist)
{
}

Stringset Class:

class Stringset
{
private:
vector<list<string>> table;
int num_elems;
int size;
public:
Stringset();
vector<list<string>> getTable() const;
int getNumElems() const;
int getSize() const;
void insert(string word);
bool find(string word) const;
void remove(string word);
};

In: Computer Science

Write a program that translates an English word into a Pig Latin word. Input ONE, and...

Write a program that translates an English word into a Pig Latin word. Input ONE, and ONLY one, word from the user, and then output its translation to Pig Latin.

The rules for converting a word to Pig Latin follow.

  1. The general form for converting a word is to remove the first letter. Then append to the end of the word a hyphen, followed by the first letter that was removed, followed by "ay". For example, "robot" becomes "obot-ray" and "Hello" becomes "ello-Hay".
  2. If the word begins with a vowel (an element of "aeiouAEIOU") simply append "-way". For example, "example" becomes "example-way" and "All" becomes "All-way".
  3. If the word begins with "th" (or "Th", "tH", or "TH"), remove the prefix and append "-thay" (or "-Thay", "-tHay", or "-THay") to the word. For example, "this" becomes "is-thay" and "The" becomes "e-Thay".

Use at least the REQUIRED METHODS listed below, with the exact same SPELLING for method names and parameters.

Input Specification

Input ONE English word as a string. If multiple words are entered ignore any beyond the first.

Use PRECISELY the format below with the EXACT same SPACING and SPELLING.

Please enter a word ==> 

Output Specification

Output an introductory message, a prompt for the English word, and a translation for the inputted word.

Use PRECISELY the format below with the EXACT same SPACING and SPELLING. The output below assumes the user entered "Hunger".

This program will convert an English word into Pig Latin.

Please enter a word ==> Hunger

"Hunger"
  in Pig Latin is
"unger-Hay"

Required Methods

// Prompt and read a word to translate
public static String  readWord (Scanner console)

// Convert a word to Pig Latin and return it
public static String  convertWord (String englishWord)

// Return true if "c" is a vowel, false otherwise.
// Handle both lowercase and uppercase letters.
public static boolean isVowel (char c)

// Print result of translation
public static void printResult (String englishWord, String pigLatinWord)

Hints

BEFORE you start coding, think about which methods each method will call. Which methods should "main" call? Create a diagram which shows the calling relationships.

There are many useful String methods listed HERE. You may find startsWith and charAt helpful.

Style

Write comments

  • Choose mnemonic, meaningful variable names (e.g. balance, interestRate)
  • Indent consistently (Ctrl+Shift+F will format your code)
  • Remember the comment block at the top of your program

In: Computer Science