Write a Python program that will process the text file, Gettysburg.txt, by calculating the total words and output the number of occurrences of each word in the file.
The program needs to open the file and process each line. You need to add each word to the dictionary with a frequency of 1 or update the word’s count by 1. You need to print the output from high to low frequency.
The program needs 4 functions.
The first function is called add_word where you add each word to the dictionary. The parameters are the word and a dictionary. There is no return value.
The second function is called Process_line where you strip off various characters, split out the words, and so on. The parameters are a line and a dictionary. It calls the add_word function with each processed word. There is no return value.
The third function is called Pretty_print where this will be the printing function. The parameter is a dictionary. There is no return value.
The fourth function is the main where it will open the file and call Process_line on each line. When finished, it will call the Pretty_print function to print the dictionary.
Gettysburg.txt
Four score and seven years ago our fathers brought forth on this continent, a new nation, conceived in Liberty, and dedicated to the proposition that all men are created equal.
Now we are engaged in a great civil war, testing whether that nation, or any nation so conceived and so dedicated, can long endure. We are met on a great battle-field of that war. We have come to dedicate a portion of that field, as a final resting place for those who here gave their lives that that nation might live. It is altogether fitting and proper that we should do this.
But, in a larger sense, we can not dedicate -- we can not consecrate -- we can not hallow -- this ground. The brave men, living and dead, who struggled here, have consecrated it, far above our poor power to add or detract. The world will little note, nor long remember what we say here, but it can never forget what they did here. It is for us the living, rather, to be dedicated here to the unfinished work which they who fought here have thus far so nobly advanced. It is rather for us to be here dedicated to the great task remaining before us -- that from these honored dead we take increased devotion to that cause for which they gave the last full measure of devotion -- that we here highly resolve that these dead shall not have died in vain -- that this nation, under God, shall have a new birth of freedom -- and that government of the people, by the people, for the people, shall not perish from the earth.
Abraham Lincoln
November 19, 1863
In: Computer Science
Financial Management
Question 1
John met his insurance agent to discuss the purchase of an insurance plan to fund his 8 year-old daughter's university education in 11 years' time. The payout from the insurance company is as follows:
* Receive $30,000 at the begining of each year for 4 years with the first receipt starting 11 years from today.
The insurance company had 3 payment proposals:
Proposal 1:
* Pay $35,000 today
Proposal 2:
* Beginning 2 years from today, pay $8,000 each year for the next 8 years.
Proposal 3:
* Beginning 2 years from today, make payments each year for the next 8 years. The first payment is $7,000 and the amount increases by 5% each year.
(a) Calculate the present value of each proposal. Use a 10% discount rate. (7m)
(b) Which proposal should John choose? Explain. (5m)
(c) If the discount rate is not given to you, what would be an appropriate discount rate to use? (3m)
In: Finance
Prepare an accounting equation from the list of transactions that has been provided.
Lita Lopez started Biz Consulting, a new business, and completed the following transactions during its first year of operations.
Required:
1. Enter the amount of each transaction on individual items of the accounting equation.
2. Determine the company's net income.
In: Accounting
Review the organization and financials of a chosen university. Describe some performance measures that might be used in assessing whether this university operates effectively. Using these measurements, how do you think the university is doing??
In: Accounting
|
Activity |
Amount, K |
|
Cash from short-term borrowing |
800,000 |
|
Cash from issuing capital stock |
2,000,000 |
|
Cash from issuing bonds payable |
10,000,000 |
|
Dividends paid |
1,000,000 |
|
Payments to settle short-term debts |
5,000,000 |
|
Cash from sales of plant assets |
3,000,000 |
|
Loans made to borrowers |
500,000 |
|
Purchases of marketable securities |
6,000,000 |
|
Collections on loans |
300,000 |
|
Purchases of plant assets |
10,000,000 |
|
Cash paid to suppliers and employees |
20,000,000 |
|
Cash received from customers |
30,000,000 |
|
Income taxes paid |
1,600,000 |
|
Interest and dividends received |
500,000 |
|
Interest paid |
1,000,000 |
|
Proceeds from sales of marketable securities |
2,000,000 |
In: Accounting
Prepare an income statement and a statement of retained earnings for the month of May (note space provided on two pages) for Shelby, Inc. Also prepare a balance sheet as of May 31, 2017. The financial transactions of Shelby, Inc. for May, their first month of operations, are:
On May 1, 2017, Shelby, Inc. issued common stock in exchange for $20,000 cash from a stockholder, Nan.
On May 3, the company borrowed $5,100 from a creditor and executed a note payable with the principal and interest to be due in one year.
On May 7, the company purchased $15,000 of equipment with cash.
On May 8, Shelby, Inc. rendered service to a client and earned $3,000 in cash.
On May 12, the company incurred a repair expense of $1,800 and promised to pay the repair contractor, Greyson, the following month.
On May 18, the company rendered service to a new client, Niki, in the amount of $8,000 on account. Niki promises to pay the following month.
At the end of May, Shelby, Inc. distributed cash dividends to BA211 stockholders for $1,200.
In: Accounting
Ace Property Company is a subsidiary of Beta Investments, Inc. Ace operates a hazardous waste disposal site. ChemiCo is one of many parties who generate waste disposed of at the site. Ace borrows money from Delta Bank, which takes over the site when Ace goes bankrupt. The bank sells the site to Eagle Company. The Environmental Protection Agency discovers a leak at the site. Can any of these private parties be forced to pay for the cleanup? If so, who?
In: Finance
Students taking the GMAT were asked about their undergraduate major and pursuit of their MBA as full time or part time student,
|
Business |
Engineering |
Other |
Total |
|
|
Full Time |
352 |
197 |
251 |
800 |
|
Part Time |
150 |
161 |
194 |
505 |
|
Total |
502 |
358 |
445 |
1305 |
If a student taking the GMAT is randomly selected from this distribution find:
In: Statistics and Probability
It appears that George is running a profitable business. George is aware you are in an MBA Managerial Finance class and comes to you for advice on his working capital practices. More specifically George asks you to do the following:
View the following video: http://searchcenter.intelecomonline.net/playClipDirect.aspx?id=4870EEC7664070BB9D6744FDA7325EE44F45E0E47862343D60FAA8E3325D1A83C46D5C6FAB3D01A758FA30144214BB3D
Describe his working capital practices, including his methods of capital budgeting analysis techniques.
Analyze the potential pitfalls in his capital budgeting practices that George should be aware of.
Develop a simple statement of cash flows for George’s Trains using any information gleaned from the video. What areas of improvement do you recommend and why?
In: Finance
On October 10, 2019, the exchange rate for the US Dollar vs. the Swedish Krona was $1 = SEK 9.95. Over the following year, the US Dollar weakened vs. the Swedish Krona and the exchange rate was $1 = SEK 8.78 on October 10, 2020. Imagine you are an executive at a Swedish company that manufactures all of its products in Sweden. You are thinking of expanding to the United States. These two questions affect of the weakening of the US Dollar vs. the Swedish Krona on the company's expansion.
a) Would your company be more likely or less likely to build your own distribution center in the United States?
b) How would the exchange rate affect the prices of your products sold in the United States? (Remember they are manufactured in Sweden.)
In: Economics