Questions
here i have a dictionary with the words and i have to find the words with...

here i have a dictionary with the words and i have to find the words with the largest size, (i mean word count for eg abdominohysterectomy) which have anagrams , like for example ,loop -> pool. Also , i have to sort them in alphabetical way so what could be the algorithm for that

public class Anagrams {
   private static final int MAX_WORD_LENGTH = 25;
   private static IArray<IVector<String>> theDictionaries =
       new Array<>(MAX_WORD_LENGTH);
   public static void main(String... args) {
       initTheDictionaies();
       process();
   }
   private static void process() {
//start here
       if (isAnagram("pool", "loop")) {                   // REMOVE
           System.out.println("ANAGRAM!");                   // REMOVE

      
//above this
   }
  
   private static boolean isAnagram(String word1, String word2) {
       boolean b = false;
       if (getWordSorted(word1).equals(getWordSorted(word2))) {
           b = true;
       }
       return b;
   }
   private static String getWordSorted(String word) {
       ISortedList<Character> sortedLetters = new SortedList<>();
       StringBuilder sb = new StringBuilder();
       for (int i = 0; i < word.length(); i++) {
           sortedLetters.add(word.charAt(i));
       }
       for (Character c : sortedLetters) {
           sb.append(c);
       }
       String sortedWord = sb.toString();
       return sortedWord;
   }
   private static void initTheDictionaies() {
       String s;
       for (int i = 0; i < theDictionaries.getSize(); i++) {
           theDictionaries.set(i, new Vector<String>());
       }
       try (
           BufferedReader br = new BufferedReader(
               new FileReader("data/pocket.dic")
           )
       ) {
           while ((s = br.readLine()) != null) {
               theDictionaries.get(s.length()).pushBack(s);
           }
       } catch (Exception ex) {
           ex.printStackTrace();
           System.exit(-1);
       }
       for (int i = 0; i < theDictionaries.getSize(); i++) {
           theDictionaries.get(i).shrinkToFit();
       }
   }
}

In: Computer Science

C++ - De Morgan’s laws commonly apply to text searching using Boolean operators AND, OR, and...

C++ -

De Morgan’s laws commonly apply to text searching using Boolean operators AND, OR, and NOT. Consider a set of documents containing the words “cars” and “trucks”. De Morgan’s laws hold that these two searches will return the same set of documents:

Search A: NOT (cars OR trucks)

Search B: (NOT cars) AND (NOT trucks)

The corpus of documents containing “cars” or “trucks” can be represented by four documents:

Document 1: Contains only the word “cars”.

Document 2: Contains only “trucks”.

Document 3: Contains both “cars” and “trucks”.

Document 4: Contains neither “cars” nor “trucks”.

To evaluate Search A, clearly the search “(cars OR trucks)” will hit on Documents 1, 2, and 3. So the negation of that search (which is Search A) will hit everything else, which is Document 4.

Evaluating Search B, the search “(NOT cars)” will hit on documents that do not contain “cars”, which is Documents 2 and 4. Similarly the search “(NOT trucks)” will hit on Documents 1 and 4. Applying the AND operator to these two searches (which is Search B) will hit on the documents that are common to these two searches, which is Document 4.

Please write a C++ program to De Morgan's Law via document search.

You can use four text files as document 1, 2 3 and 4.

Using this Assignment, read a document and create frequency map. Take the frequency map and display histogram for each word in the document.

Draw histogram in horizontal direction.

This (6) **********

my (4) ******

Truck (6) *********

In: Computer Science

Scenario: You are the assistant superintendant for a high-rise building contractor who specializes in governmental building...

Scenario: You are the assistant superintendant for a high-rise building contractor who specializes in governmental building contracts. Your company, based in Baltimore, MD, was just successful in winning a new job in NY City. This will be your first job in the big apple and your boss, the superintendent "Sam Super" is concerned about recent crane problems that he has been reading about.

He asks for your opinion about the crane safety and crane operations management.

You respond to Sam, wanting to make a good impression, that you will do some research and present him with a report on the topic. Same says "that's a good idea, college boy" and you agree to get to work on it. Knowing that Sam has a famously short attention span you decide to present your research in a concise one-page format.

Instruction:

  • Research the topic of crane safety and crane operations management as follows:
    • Google news articles available with a keyword of "crane accident"
    • Read several crane accident related articles
    • Summarize at least two articles with your opinion to create a good report for Sam
    • In the report, put references of the articles that you refer to.
  • Submit a one-page report as a Word file to Sam (the word count of your report should be no less than 400) in order to give him a current perspective on crane safety and issues
    • DO NOT cut and paste any portions of the articles into your report. Write the report in your own words based on your research of the articles.

In: Operations Management

CIS247C WEEK 2 LAB The following problem should be created as a project in Visual Studio,...

CIS247C WEEK 2 LAB

The following problem should be created as a project in Visual Studio, compiled and debugged. Copy your code into a Word document named with your last name included such as: CIS247_Lab2_Smith. Also include screen prints of your test runs. Be sure to run enough tests to show the full operation of your code. Submit this Word document and the project file (zipped).

The Zoo Class

This class describes a zoo including some general visitor information. We will code this class using the UML below. There is a video in the announcements on how to code a class from a UML diagram. There is also an example shown by the Exercise we complete together in the Week 2 class.

It is required to use a header file for your class definition that contains the private attributes and prototypes for the functions (no code in the header file!) Use a .cpp file for the code of the functions. Then create a separate .cpp file for the main function.

The file with the main function should have a documentation header:

/*

            Programmer Name: Your Name

            Program: Zoo Class

            Date: Current date

            Purpose: Demonstrate coding a simple class and creating objects from it.

*/

Coding the Zoo Class

Create a header file named: Zoo.h and a .cpp file named: Zoo.cpp. The easiest way to do this is to use the “Add Class” function of Visual Studio.

In the header file, put your class definition, following the UML as a guide. In the private access section, declare your variables. In the public access section, list prototypes (no code) for the two constructors, setters and getters and the other functions shown.

Zoo

-zooName : string   //example: Brookfield Zoo

-zooLocation : string     //city, state

-yearlyVisitors : int

-adultAdmissionCost : double

+Zoo()   //default constructor should zero numbers and set strings to “unknown”

+Zoo(name : string, place : string, visitors: int, cost : double)

+getName() : string

+getLoc() : string

+getVisitors() : int

+getAdmission() : double

+setName(name : string) : void

+setLoc(place : string) : void

+setVisitors(visitors : int) : void

+setAdmission(cost : double) : void

+printInfo() : void    //prints the name, location, visitors and adult admission cost

In the Zoo.cpp file, put the code for all the functions. Remember to put the class name and scope resolution operator in front of all function names.

Example setter:

void Zoo::setVisitors(int visitors) {yearlyVisitors = visitors;}

Example getter:

int Zoo:getVisitors() {return yearlyVisitors;}

In the .cpp file for the main function, be sure to add this to your includes:

#include “Zoo.h”

Here is some high level pseudocode for your main function:

main

            declare 2 string variables for the name and location

            declare int variable for the number of visitors

            declare double variable for the adult admission cost

            declare a Zoo object with no parentheses (uses default constructor)

            set a name for the Zoo (name of your choice such as “Brookfield Zoo”)

            set a location for the Zoo in the format: city, state (example: “Chicago, IL”)

            set the yearly number of visitors (any amount)

            set the adult admission cost (any amount)

            //use proper money formatting for the following

            use the printInfo() method to print the Zoo object’s information

            //Preparing for the second Zoo object

            //Suggestion: use getline(cin, variable) for the strings instead of cin

            Ask the user for a zoo name and input name into local variable declared above

            Ask the user for the zoo location and input the location into local variable

            Ask the user for the zoo yearly number of visitors and input into local variable

            Ask the user for the adult admission cost and input into local variable

            //Using the constructor with parameters to create an object

            declare a Zoo object and pass the four local variables in the parentheses

            use the printInfo() method to print the Zoo object’s information

end main function

SUBMITTING YOUR PROGRAM

When you are done testing your program, check that you have used proper documentation. Then copy and paste your code from Visual Studio into a Word document. Be sure to copy all three files. Take a screenshot of the console window with your program output. Paste this into the same document.

Save your Word document as: CIS247_Week2Lab_YourLastName.

Submit your Word document and also the properly zipped project folder.

C++ language

In: Computer Science

implement the above in c++, you will write a test program named create_and_test_hash.cc . Your programs...

implement the above in c++, you will write a test program named create_and_test_hash.cc . Your programs should run from the terminal like so:
./create_and_test_hash <words file name> <query words file name> <flag> <flag> should be “quadratic” for quadratic probing, “linear” for linear probing, and “double” for double hashing. For example, you can write on the terminal:
./create_and_test_hash words.txt query_words.txt quadratic You can use the provided makefile in order to compile and test your code. Resources have been posted on how to use makefiles. For double hashing, the format will be slightly different, namely as follows:
./create_and_test_hash words.txt query_words.txt double <R VALUE> The R value should be used in your implementation of the double hashing technique discussed in class and described in the textbook: hash2 (x) = R – (x mod R). Q1. Part 1 (15 points) Modify the code provided, for quadratic and linear probing and test create_and_test_hash. Do NOT write any functionality inside the main() function within create_and_test_hash.cc. Write all functionality inside the testWrapperFunction() within that file. We will be using our own main, directly calling testWrapperFunction().This wrapper function is passed all the command line arguments as you would normally have in a main. You will print the values mentioned in part A above, followed by queried words, whether they are found, and how many probes it took to determine so. Exact deliverables and output format are described at the end of the file. Q1. Part 2 (20 points) Write code to implement double_hashing.h, and test using create_and_test_hash. This will be a variation on quadratic probing. The difference will lie in the function FindPos(), that has to now provide probes using a different strategy. As the second hash function, use the one discussed in class and found in the textbook hash2 (x) = R – (x mod R). We will test your code with our own R values. Further, please specify which R values you used for testing your program inside your README. Remember to NOT have any functionality inside the main() of create_and_test_hash.cc
You will print the current R value, the values mentioned in part A above, followed by queried words, whether they are found, and how many probes it took to determine so. Exact deliverables and output format are described at the end of the file. Q1. Part 3 (35 points) Now you are ready to implement a spell checker by using a linear or quadratic or double hashing algorithm. Given a document, your program should output all of the correctly spelled words, labeled as such, and all of the misspelled words. For each misspelled word you should provide a list of candidate corrections from the dictionary, that can be formed by applying one of the following rules to the misspelled word: a) Adding one character in any possible position b) Removing one character from the word c) Swapping adjacent characters in the word Your program should run as follows: ./spell_check <document file> <dictionary file>

You will be provided with a small document named document1_short.txt, document_1.txt, and a dictionary file with approximately 100k words named wordsEN.txt. As an example, your spell checker should correct the following mistakes. comlete -> complete (case a) deciasion -> decision (case b) lwa -> law (case c)

Correct any word that does not exist in the dictionary file provided, (even if it is correct in the English language). Some hints: 1. Note that the dictionary we provide is a subset of the actual English dictionary, as long as your spell check is logical you will get the grade. For instance, the letter “i” is not in the dictionary and the correction could be “in”, “if” or even “hi”. This is an acceptable output. 2. Also, if “Editor’s” is corrected to “editors” that is ok. (case B, remove character) 3. We suggest all punctuation at the beginning and end be removed and for all words convert the letters to lower case (for e.g. Hello! is replaced with hello, before the spell checking itself).

Do NOT write any functionality inside the main() function within spell_check.cc. Write all functionality inside the testSpellingWrapper() within that file. We will be using our own main, directly calling testSpellingWrapper(). This wrapper function is passed all the command line arguments as you would normally have in a main

In: Computer Science

please use word QUESTION 5 (16 minutes; 9 marks):   Queenstown Corporation issues 4,000, $4 cumulativepreferred shares...

please use word

QUESTION 5 (16 minutes; 9 marks):  

Queenstown Corporation issues 4,000, $4 cumulativepreferred shares at $80 each and 12,000 common shares at $18 at the beginning of 2020. Each preferred share is convertible into four common shares. During the years 2020 and 2021, the following transactions affected Queenstown Corporation’s shareholders’ equity accounts:

2020

Dec. 10      Declared and paid $12,000 of annual dividends to preferred shareholders.

2021

Dec. 10      Declared and paid the annual dividend to preferred shareholders and a $4,000 dividend to common shareholders.

Dec. 21      The preferred shares were converted into common shares.

Required:

a)         Journalize each of the 2020 and 2021 transactions.

b)         After the preferred shares are converted, what is the total number of common shares issued?

In: Accounting

Must include Reference page(s). Citation style MLA/APA, your choice. Minimum word counts: 600 Changes in the...

Must include Reference page(s). Citation style MLA/APA, your choice.

Minimum word counts: 600

Changes in the value of a nation’s currency affect the nation’s net exports, and thus GDP. How might this make a large country, like the U.S., more willing to adopt a flexible exchange rate regime than a small country, like Belgium.

.Criteria

why do large countries, like the U.S., typically have a lower portion of their GDP as exports and imports, than a small country like Belgium ?

How does the size of a nation’s trade sector affect the stability of its GDP?

How do exchange rate fluctuations affect a nation’s GDP?

Why might a large country be more willing to adopt a flexible exchange rate than a small country would?

Write up your analysis using correct language, explaining all your work

In: Economics

Word search: thirty, Gosset, one less than sample size, Beta, Type I error, Central Limit Theorem...


Word search: thirty, Gosset, one less than sample size, Beta, Type I error, Central Limit Theorem (C.L.T.), correct decision, Alpha, Guinness Brewery, Type II error. (entry may be used more than once, choose best item)

a) Rejecting the null hypothesis when it is incorrect. ___________________.

b) Probability of making a Type II error. ________________.

c) Degrees of freedom (as used in t-distribution) ______________________.

d) Theory that justifies much of inferential statistics.___________________.

e) Sample size traditionally used by statisticians to separate large and small samples. ____________________.

f) Student (of Student's t distribution) _____________________.

g) Failing to reject the null hypothesis when it is incorrect. _______________.

h) Student's employer. ______________________.

i) Fail to reject null hypothesis when it is correct. ___________________.

j) Probability of making a Type I error. ______________________.

k) Rejecting the null hypothesis when it is correct. _________________.



please have a clear answer and explain please.

In: Statistics and Probability

Word limit: 800-1000 words Questions: Buyers determine demand while sellers determine supply. Both laws of supply...

Word limit: 800-1000 words

Questions: Buyers determine demand while sellers determine supply. Both laws of supply and demand establish market forces that make economies work to search for their market equilibrium. The impact of COVID-19 is an unprecedented event that affects the global economy. The overall retail sales dramatically dropped by 34.8%, with jewellery and luxury goods drop of 67% but supermarkets increase of 12%, in the first five months of 2020. However, online-based consumption, like demand for food delivery, online education (Zoom), stay-at-home activities and online grocery shopping surged dramatically since the outbreak of pandemic.

1) Based on your learning in Microeconomics, explain how COVID-19 has a favourable and an adverse impact in today’s situation, with aids of diagram “Market Forces of Supply and Demand” and “Elasticity”.

2) Illustrate with TWO real examples (one favourable and one adverse impact) in the retail industry in Hong Kong or Mainland China or your country to show your understanding and application of supply and demand as well as elasticity.

3) Principle 6 of Economics states, “Markets are usually a good way to organize economic activity”. Hopefully COVID-19 will end some time in the near future. Predict how the retail industry would become in the economy with the aftermath of the pandemic.

In: Economics

1.Consider the program: .data myArray: .word 1, 2, 3, 4, 5, 6, 7, 8, 9, 10...

1.Consider the program:

.data

myArray: .word 1, 2, 3, 4, 5, 6, 7, 8, 9, 10

.text

la $s0, myArray

li $s1, 0

loop: sll $t0, $s1, 2

add $t0, $t0, $s0

lw $s2, 0($t0)

lw $s3, 4($t0)

add $s2, $s2, $s3

sw $s2, 0($t0)

addi $s1, $s1, 1

slti $t1, $s1, 9

bne $t1, $zero, loop

.end

Explain what does this program do? How is the data bound from the .data segment to the base address register $s0? What address does Spim use for 0th element of array in $s0?

In: Computer Science