Reference no: EM131395231
Problem 1(a): Pig Latin.
In "Pig Latin", English words are transformed according to the following rules:
If the word begins with one or more consonants, those consonants are moved to the end of the word, followed by "ay":
- pig -> igpay
- Latin -> Atinlay
- trash -> ashtray
If the word begins with a vowel, it is followed by "yay":
- apple -> appleyay
- out -> outyay.
Note that more than one consonant may be moved to the end of the word. Note also that"y" functions as a consonant at the start of words. Note also that capitalization should be preserved after manipulating the word.
Write Python code that takes a word and converts it to Pig Latin. If the input consists of multiple words or contains punctuation, your code should print a suitable error message.
Problem 1(b): Test Suite.
Test your code on the following words, and be sure your output matches what is shown on the right hand side of each arrow. Print the results of each test. If your output does not match, then fix your code in 1(a).
* orange -> orangeyay
* yellow -> ellowyay
* Strip -> Ipstray
* quarter -> arterquay
* schmooze -> oozeschmay
* a -> ayay
* Pig Latin -> (should produce an error message)
* Ke$ha -> (should produce an error message)
Problem 2(a): Letter Frequencies.
The files encryptedA.txt and encryptedB.txt contain two different encrypted messages on similar topics. One message was originally in English and one was in Welsh.
Write Python code that reads a text file into memory and creates a dictionary object with a frequency count for each letter. For example, for encryptedA.txt, your output should contain the key:value pairs 'a': 78 and 'b': 31. Do not distinguish between uppercase and lowercase letters, and ignore punctuation. If a given letter does not appear in the text, there should be a key:value pair with value 0.
Use Python to determine which letter has the highest frequency in each text file, and print the result.
Problem 2(b): Formatting for R.
Write your dictionaries with frequency counts to .csv files, with one column for the key and one column for the frequency counted.
Form of argumentation - circle
: Determine whether the following arguments are inductive or deductive. If an argument is inductive, determine whether it is strong or weak. If it is deductive, determine whether it is valid or invalid.
|
Is there sufficient evidence of fraud
: From a project management perspective, is there sufficient evidence of fraud? Why or why not? If you were Paul, what evidence would you bring to either support fraud or deny that fraud existed? How do you think the case study ended? Why?
|
Create the appropriate relationships between each entity
: If you're using Visio, see "Appendix A: Designing Databases with Visio Professional 2010: A Tutorial" to help you complete Section 1: Modified Visio Database Design. For each student, the college needs to track the student ID, student names, addre..
|
Determine whether it is strong or weak
: Determine whether the following arguments are inductive or deductive. If an argument is inductive, determine whether it is strong or weak. If it is deductive, determine whether it is valid or invalid.
|
Write python code that takes word and converts to pig latin
: Write Python code that takes a word and converts it to Pig Latin. If the input consists of multiple words or contains punctuation, your code should print a suitable error message
|
Statement is redundant or plays no role in the argument
: Use the method presented in this section to construct argument patterns. If a statement is redundant or plays no role in the argument, do not include it in the pattern.
|
Government policy of managing the country
: Briefly explain the "pros" and "cons" of a government policy of "managing"the country's foreign exchange rate as compared to a policy of letting the exchange rate "free float" according to prevailing market forces.
|
In which direction does the stack grow
: In which direction does the stack grow: upward toward higher addresses or downward toward lower addresses? In an array on the free store, are elements with higher indices allocated at higher or lower addresses?
|
What will be the systems money supply
: Assume a financial system has a monetary base (MB) of $25 million. The required reserves ratio is 10 percent and no leakeges are in the system. What is the size of the money multiplier (m)? What will be the systems money supply?
|