Questions
Write a Python program for the following: A given author will use roughly use the same...

Write a Python program for the following:

A given author will use roughly use the same proportion of, say, four-letter words in something she writes this year as she did in whatever she wrote last year. The same holds true for words of any length. BUT, the proportion of four-letter words that Author A consistently uses will very likely be different than the proportion of four-letter words that Author B uses. Theoretically, then, authorship controversies can sometimes be resolved by computing the proportion of 1-letter, 2-letter, 3-letter, ..., 13-letter words in the writing and then comparing it with the same statistics from known authors.

Your task is to write a Python program that computes the above statistics from any text file. Note that apostrophes do not count in the word length. For example, "he's" is a three-letter word. Words like hard-hearted should be replaced with two words with a space between them (hard hearted).

Name of input file: romeo_and_juliet.txt

Proportion of 1- letter words: 4.8% (1231 words)

Proportion of 2- letter words: 16.1% (4177 words)

Proportion of 3- letter words: 20.3% (5261 words)

Proportion of 4- letter words: 24.3% (6295 words)

Proportion of 5- letter words: 15.0% (3889 words)

Proportion of 6- letter words: 7.9% (2048 words)

Proportion of 7- letter words: 5.2% (1352 words)

Proportion of 8- letter words: 3.7% (953 words)

Proportion of 9- letter words: 1.5% (378 words)

Proportion of 10- letter words: 0.7% (190 words)

Proportion of 11- letter words: 0.3% (71 words)

Proportion of 12- letter words: 0.1% (20 words)

Proportion of 13- (or more) letter words: 0.0% (12 words)

Here the program is tested on the full text of Romeo and Juliet but it should work for any file. The sample run above shows the actual proportion and count of different sized words in the file. Hint: make sure to replace each character in ",.!?;:][-\"" in the text with a space before doing any splitting.

In: Computer Science

Summary Paragraph Assignment Requirements of the Assignment: Use Times New Roman font size 12, double-spaced for...

Summary Paragraph Assignment

Requirements of the Assignment:

Use Times New Roman font size 12, double-spaced for this assignment

Write a one-paragraph summary of the article, “Why it Costs so Much to be Poor in America”, published in The Washington Post on January 25, 2018. The paragraph should contain 10-15 sentences and include the following:

  • A summary sentence
  • The author’s full name
  • The full title in quotations and capitalized correctly
  • The author’s main point(s) and supporting points
  • When it was written
  • Where it was originally published (this is not a geographical location!)

Summary Assignment

     Have you ever wondered how much it costs to be poor in America? Well, it costs more than most people realize. Karen Wesse, a freelance writer, wrote the article, "Why it Costs so Much to be Poor in America", that was published in The Washington Post on January 25, 2018. In this article, she reveals why life is tough for low-income people in America and how much it costs low-income people to live on this land. She states that it has never been easy to be poor in America because of fines, fees, and exorbitant interest rates that make life difficult for low-income families. She explains how unfair it is to charge low-income people fees, penalties, and high-interest rates even though banks make billions of profits like Bank of America which made more than $21 billion in profits last year. Weese argues that poor peoples’ income fluctuates because their income is contingent due to the hours they work from week to week, and she acknowledges that more than 40 percent of the people that live in America state that they struggle to make it to the end of the month. The author also explains how low income people struggle without a stable income to cover unexpected costs such as car repairs and medical bills. She states that for poor people, it takes one unexpected bill to throw everything off, which causes bank overdraft fees, commonly $35 apiece. Furthermore, the author criticizes banks for pushing the larger transactions through bank accounts before smaller ones, which creates more debt for lower-income people. Wesse affirms that poor people pay more for food because some people have no other options but buying from convenience stores, and some people can’t effort memberships to places like Costco where food is cheaper. Finally, the author believes the current legal protection for poor people is inadequate and will not be able to protect them from unforeseen costs. She proposes possible solutions to help low-income people, such as temperate legal protection, a small policy change, less banking fees and fines, and lower interest rates. This author describes how much it costs to be poor in America and the difficulties that low-income people face. In conclusion, the author clarifies how low-income people, living in America, struggle.

Please write one paragraph and should contain10-15 sentences. Thank You.

In: Economics

1-    Explain why it is necessary and important to analyze the marketing environment 2-    For each actor/ force...

1-    Explain why it is necessary and important to analyze the marketing environment

2-    For each actor/ force explained in the lecture (macro & micro) give a brief explanation, explain its important for marketers, find a real-life company example for each and explain in detail.

3-    Choose a product, how would you market it to different generations? Explain your strategies for each generational cohort and indicate why you chose that strategy.

In: Economics

3. The odds ratio will most closely approximate the risk ratio from which of the following...

3. The odds ratio will most closely approximate the risk ratio from which of the following hypothetical cohort studies that have the stated risks in the exposed and unexposed groups?

a. 1% risk of disease in the unexposed, 2% risk in the exposed b. 5% risk of disease in the unexposed, 10% risk in the exposed c. 10% risk of disease in the unexposed, 20% risk in the exposed d. 20% risk of disease in the unexposed, 40% risk in the exposed

In: Statistics and Probability

Here are the projected numbers (in thousands) of earned degrees in a certain country during one...

Here are the projected numbers (in thousands) of earned degrees in a certain country during one academic year, classified by level and by the sex of the degree recipient:

Bachelor's Master's Professional Doctorate
Female 932 403 52 28
Male 663 270 42 28

Use these data to answer the following questions.

(a) What is the probability that a randomly chosen degree recipient is a man? (Round your answer to four decimal places.)


(b) What is the conditional probability that the person chosen received a bachelor's degree, given that he is a man? (Round your answer to four decimal places.)


(c) Use the multiplication rule to find the probability of choosing a male bachelor's degree recipient. Check your result by finding this probability directly from the table of counts. (Round your answer to four decimal places.)

In: Statistics and Probability

7.7 Ch 7 Program: Online shopping cart (continued) (C) This program extends the earlier "Online shopping...

7.7 Ch 7 Program: Online shopping cart (continued) (C)

This program extends the earlier "Online shopping cart" program. (Consider first saving your earlier program).

(1) Extend the ItemToPurchase struct to contain a new data member. (2 pt)

  • char itemDescription[ ] - set to "none" in MakeItemBlank()

Implement the following related functions for the ItemToPurchase struct.

  • PrintItemDescription()
    • Has an ItemToPurchase parameter.


Ex. of PrintItemDescription() output:

Bottled Water: Deer Park, 12 oz.


(2) Create three new files:

  • ShoppingCart.h - struct definition and related function declarations
  • ShoppingCart.c - related function definitions
  • main.c - main() function (Note: main()'s functionality differs from the warm up)

Build the ShoppingCart struct with the following data members and related functions. Note: Some can be function stubs (empty functions) initially, to be completed in later steps.

  • Data members (3 pts)
    • char customerName [ ]
    • char currentDate [ ]
    • ItemToPurchase cartItems [ ] - has a maximum of 10 slots (can hold up to 10 items of any quantity)
    • int cartSize - the number of filled slots in array (number of items in cart of any quantity)
  • Related functions
    • AddItem()
      • Adds an item to cartItems array. Has parameters ItemToPurchase and ShoppingCart. Returns ShoppingCart object.
    • RemoveItem()
      • Removes item from cartItems array (does not just set quantity to 0; removed item will not take up a slot in array). Has a char[ ](an item's name) and a ShoppingCart parameter. Returns ShoppingCart object.
      • If item name cannot be found, output this message: Item not found in cart. Nothing removed.
    • ModifyItem()
      • Modifies an item's description, price, and/or quantity. Has parameters ItemToPurchase and ShoppingCart. Returns ShoppingCart object.
    • GetNumItemsInCart() (2 pts)
      • Returns quantity of all items in cart. Has a ShoppingCart parameter.
    • GetCostOfCart() (2 pts)
      • Determines and returns the total cost of items in cart. Has a ShoppingCart parameter.
    • PrintTotal()
      • Outputs total of objects in cart. Has a ShoppingCart parameter.
      • If cart is empty, output this message: SHOPPING CART IS EMPTY
    • PrintDescriptions()
      • Outputs each item's description. Has a ShoppingCart parameter.


Ex. of PrintTotal() output:

John Doe's Shopping Cart - February 1, 2016
Number of Items: 8

Nike Romaleos 2 @ $189 = $378
Chocolate Chips 5 @ $3 = $15
Powerbeats 2 Headphones 1 @ $128 = $128

Total: $521


Ex. of PrintDescriptions() output:

John Doe's Shopping Cart - February 1, 2016

Item Descriptions
Nike Romaleos: Volt color, Weightlifting shoes
Chocolate Chips: Semi-sweet
Powerbeats Headphones: Bluetooth headphones


(3) In main(), prompt the user for a customer's name and today's date. Output the name and date. Create an object of type ShoppingCart. (1 pt)

Ex.

Enter Customer's Name:
John Doe
Enter Today's Date:
February 1, 2016

Customer Name: John Doe
Today's Date: February 1, 2016


(4) Implement the PrintMenu() function. PrintMenu() has a ShoppingCart parameter, and outputs a menu of options to manipulate the shopping cart. Each option is represented by a single character. Build and output the menu within the function.

If the an invalid character is entered, continue to prompt for a valid choice. Hint: Implement Quit before implementing other options. Call PrintMenu() in the main() function. Continue to execute the menu until the user enters q to Quit. (3 pts)

Ex:

MENU
a - Add item to cart
r - Remove item from cart
c - Change item quantity
i - Output items' descriptions
o - Output shopping cart
q - Quit

Choose an option:


(5) Implement the "Output shopping cart" menu option. (3 pts)

Ex:

OUTPUT SHOPPING CART
John Doe's Shopping Cart - February 1, 2016
Number of Items: 8

Nike Romaleos 2 @ $189 = $378
Chocolate Chips 5 @ $3 = $15
Powerbeats Headphones 1 @ $128 = $128

Total: $521


(6) Implement the "Output item's description" menu option. (2 pts)

Ex.

OUTPUT ITEMS' DESCRIPTIONS
John Doe's Shopping Cart - February 1, 2016

Item Descriptions
Nike Romaleos: Volt color, Weightlifting shoes
Chocolate Chips: Semi-sweet
Powerbeats Headphones: Bluetooth headphones


(7) Implement "Add item to cart" menu option. (3 pts)

Ex:

ADD ITEM TO CART
Enter the item name:
Nike Romaleos
Enter the item description:
Volt color, Weightlifting shoes
Enter the item price:
189
Enter the item quantity:
2


(8) Implement the "Remove item from cart" menu option. (4 pts)

Ex:

REMOVE ITEM FROM CART
Enter name of item to remove:
Chocolate Chips


(9) Implement "Change item quantity" menu option. Hint: Make new ItemToPurchase object before using ModifyItem() function. (5 pts)

Ex:

CHANGE ITEM QUANTITY
Enter the item name:
Nike Romaleos
Enter the new quantity:
3

In: Computer Science

What information should the author communicate to the audience/reader in the introduction of a reserch proposal...

What information should the author communicate to the audience/reader in the introduction of a reserch proposal paper.

In: Nursing

Puzzle #4 Five friends each wrote a letter to Santa Claus, pleading for certain presents. What...

Puzzle #4

Five friends each wrote a letter to Santa Claus, pleading for certain presents. What is the full

name of each letter-writer and how many presents did he or she ask for? Kids’ names: Danny,

Joelle, Leslie, Sylvia, and Yvonne. Last names: Croft, Dean, Mason, Palmer, and Willis. Number

of presents requested: 5, 6, 8, 9, and 10.

Clues:

1. Danny asked for one fewer present that the number on Yvonne’s list.

2. The child surnamed Dean asked for one more present than the number on the list written by

the child surnamed Palmer.

3. Sylvia’s list featured the fewest presents, and the letter written by the child surnamed Willis

featured the highest quantity.

4. Joelle asked for one fewer present than the number specified in the Croft child’s letter.

Make your grid to solve:

Croft

Dean Mason Palmer Willis

5

6

8

9

10

Danny

Joelle

Leslie

Sylvia

Yvonee

5 presents

6 presents

8 presents

9 presents

10 presents

Your final answers to puzzle 4:

In: Statistics and Probability

Using WORKBENCH: 1. Create the database below via an ER Diagram in Workbench (take screen shots...

Using WORKBENCH:

1. Create the database below via an ER Diagram in Workbench (take screen shots of the diagram)

2. Go to the database table view and take a screen shot of the table(s)

3. Go to the data entry tool and enter at least three lines of data (in each table). Take screen shots.

Create a database that is in third normal form for the following:

You are a nerd and have decided to organize your comic books in a database.

You have decided to create categories for the books. The categories a a separate table because it includes the category name and a description of the category. The names might not be unique.

You also want to keep track of the size (width and length) of each book (I did say you were a nerd..LOL). Since several books are the same size, you decide to also keep this in a separate table.

You have books from several publishers, so you decide to create a publishers table. In the table you have the publisher and the address of their home office.

Finally, of course, you have the books table. The books table (of course) includes the name and author but also links to the other tables.

Be creative!

Make sure to populate all tables!

In: Computer Science

How does gender and occupational prestige affect credibility? Graduate students in a public health program are...

How does gender and occupational prestige affect credibility? Graduate students in a public health program are asked to rate the strength of a paper about the health risks of childhood obesity. In reality, all student raters are given the same paper, but the name and degree associated with the author are changed. The student raters are randomly assigned to one group from the following name ("John Lake", "Joan Lake") and degree (M.D., R.N., Ph.D.) combination. The raters score the paper from 1 to 5 on clarity, strength of argument, and thoroughness. The total scores (the sum of the three scores) are given in the table below. What can be concluded with an α of 0.05?

John Lake /
M.D.
John Lake /
R.N.
John Lake /
Ph.D.
Joan Lake /
M.D.
Joan Lake /
R.N.
Joan Lake /
Ph.D.
12
15
13
15
14
15
16
12
13
13
11
8
13
12
9
15
10
12
14
12
10
7
8
10
6
11
11
12
8
8


a) What is the appropriate test statistic?
---Select--- na one-way ANOVA within-subjects ANOVA two-way ANOVA

b) Compute the appropriate test statistic(s) to make a decision about H0.
Name: p-value =  ; Decision:  ---Select--- Reject H0 Fail to reject H0
Degree: p-value =  ; Decision:  ---Select--- Reject H0 Fail to reject H0
Interaction: p-value =  ; Decision:  ---Select--- Reject H0 Fail to reject H0


c) Compute the corresponding effect size(s) and indicate magnitude(s).
Name: η2 =  ;  ---Select--- na trivial effect small effect medium effect large effect
Degree: η2 =  ;  ---Select--- na trivial effect small effect medium effect large effect
Interaction: η2 =  ;  ---Select--- na trivial effect small effect medium effect large effect


d) Make an interpretation based on the results.

There is a name difference in the total scores.There is no name difference in the total scores.    

There is a degree difference in the total scores.There is no degree difference in the total scores.    

There is a name by degree interaction in the total scores.There is no name by degree interaction in the total scores.    

In: Statistics and Probability