the required return is 21 percent and the company just paid a GH¢1.50 dividend, what is the current share price?
In: Finance
CSCE 3600: Systems Programming
Recitation Assignment 3 – Sed and Gawk
Due: 06:00 PM on Monday October 12 2020
DESCRIPTION: In this recitation assignment, you will just practice to run sed and gawk commands and record your work session into a file. In other words, just type and run commands specified in bold Consolas (except $ sign :) below on your terminal.
Let’s start. First, open a terminal (bash) session. Issue the first command
$ script FirsName_LastName_04.txt
where FirsName_LastName_04.txt is a file name with FirstName_LastName replaced with your real names. That command will start recording of your work into that file.
The sed commands: go to one of your directories that contains plenty of files (more than 10)
$ cd name-of-directory-with-more-than-10-files
and then in that directory create a list of files by issuing the following command
$ ls –l > sedfile.txt
Print 5 lines of sedfile.txt file to the terminal using statement
$ sed –n 1,5p sedfile.txt
Replace the first “-“character on lines in the file with “R”
$ sed –i "s/^-/R/g" sedfile.txt
-i option instructs sed to replace the original file with output file it creates.
Print 5 lines of sedfile.txt file again to see what was changed
$ sed –n 1,5p sedfile.txt
Delete the first line in the file
$ sed –i 1d sedfile.txt
Find some pattern on one of the lines in the file (like name, date, or memory size) and issue the following command to add new line after that pattern.
$ sed –i '/YOUR PATTERN/a This will be added as new line'
Print out the first 10 lines of your sedfile.txt file again to verify that these changes (deleting the first line and adding a new line) worked:
$ sed –n 1,10p sedfile.txt
Now let’s work with gawk. Create a list of running processes on your system by issuing the following command from your command prompt as follows:
$ ps –ef > gawkfile.txt
Print gawkfile.txt using the NR system variable as follows:
$ gawk 'NR <= 10' gawkfile.txt
This should display the first 10 lines of your gawkfile.txt file. Processes will be covered in detail a little later on in this course. So how many processes are running on your system?
$ gawk 'END {print NR}' gawkfile.txt
Since our gawkfile.txt file contains a header with the fields, we should have 1 less process running on our system. Let’s try to print out only those processes that only you are running. This means that we want to print out some fields where the UID is your user ID. If you do not know your user ID, you can issue the whoami command at your command prompt to find out.
$ gawk '/YOUR USER ID/{print NR, $0}' gawkfile.txt
Let’s see what is result of matching on the first field ($1)?
$ gawk '$1 ~ /YOUR USER ID/{print NR, $0}' gawkfile.txt
That ensures that only the processes that you own are printed!
We see that the first line of gawkfile.txt contains a header with most likely 8 fields (i.e., UID, PID, PPID, C, STIME, TTY, TIME, and CMD, though there might be some variation in different Linux distributions). However, because we use the default field separator of whitespace, some records might contain more fields. So, let’s print out those records that have more than 8 fields. We use here gawk variables NR and NF.
$ gawk 'NF > 8 {print NR, NF}' gawkfile.txt
Now, we print only fields from 9th to max (NF) on line if line contains more than 8 fields.
$ gawk 'NF>8 {for(i=9; i<=NF; i++) print NR, NF, $i}' gawkfile.txt
Now, we swap the PID (field $2) and PPID (field $3) columns so that each record lists the parents’ process ID first by just printing field in the specified order below (3 before 2).
$ gawk 'BEGIN {OFS="\t"};{print $1,$3,$2,$4,$5,$6,$7,$8}' gawkfile.txt
OFS above is Output Field Separator, so fields in output should be separated by a Tab.
To output result of gawk command to a file instead of terminal you can use redirection
$ gawk 'BEGIN {OFS="\t"};{print $1,$2,$3,$5}' gawkfile.txt > out
Let’s finish your recording session and close your script file
$ exit
You should see now FirsName_LastName_04.txt in the current directory.
REQUIREMENTS: Your typescript file will be graded based largely on whether you completed the work correctly, so you should make sure you obtained meaningful results from each command. • Although this assignment is to be submitted individually (i.e., each student will submit his/her own source code), you may receive assistance from your TA, IA (i.e., Grader), and even other classmates. Please remember that you are ultimately responsible for learning and comprehending this material as the recitation assignments are given in preparation for the minor assignments, which must be completed individually.
SUBMISSION: You will electronically submit your typescript file FirsName_LastName_04.txt to the Recitation 3 drop box in Canvas by the due date and time. No late recitation assignments will be accepted.
In: Computer Science
Hemming Co. reported the following current-year purchases and sales
for its only product.
| Date | Activities | Units Acquired at Cost | Units Sold at Retail | |||||||||||||
| Jan. | 1 | Beginning inventory | 220 | units | @ $10.80 | = | $ | 2,376 | ||||||||
| Jan. | 10 | Sales | 190 | units | @ $40.80 | |||||||||||
| Mar. | 14 | Purchase | 330 | units | @ $15.80 | = | 5,214 | |||||||||
| Mar. | 15 | Sales | 280 | units | @ $40.80 | |||||||||||
| July | 30 | Purchase | 420 | units | @ $20.80 | = | 8,736 | |||||||||
| Oct. | 5 | Sales | 390 | units | @ $40.80 | |||||||||||
| Oct. | 26 | Purchase | 120 | units | @ $25.80 | = | 3,096 | |||||||||
| Totals | 1,090 | units | $ | 19,422 | 860 | units | ||||||||||
Required:
Hemming uses a periodic inventory system.
(a) Determine the costs assigned to ending inventory and to cost of
goods sold using FIFO.
(b) Determine the costs assigned to ending inventory and to cost of goods sold using LIFO.
(c) Compute the gross margin for each method.
Required:
Hemming uses a periodic inventory system.
(a) Determine the costs assigned to ending inventory and to cost of
goods sold using FIFO.
(b) Determine the costs assigned to ending inventory and to cost of goods sold using LIFO.
(c) Compute the gross margin for each method.
| a) Periodic FIFO | Cost of Goods Available for Sale | Cost of Goods Sold | Ending Inventory | ||||||
| # of units | Cost per unit | Cost of Goods Available for Sale | # of units sold | Cost per unit | Cost of Goods Sold | # of units in ending inventory | Cost per unit | Ending Inventory | |
| Beginning inventory | not attempted | not attempted | not attempted | not attempted | |||||
| Purchases: | |||||||||
| March 14 | not attempted | not attempted | not attempted | not attempted | |||||
| July 30 | not attempted | not attempted | not attempted | not attempted | |||||
| October 26 | not attempted | not attempted | not attempted | not attempted | |||||
| Total | 0 | $0 | 0 | $0 | 0 | $0 | |||
| b) Periodic LIFO | Cost of Goods Available for Sale | Cost of Goods Sold | Ending Inventory | ||||||
| # of units | Cost per unit | Cost of Goods Available for Sale | # of units sold | Cost per unit | Cost of Goods Sold | # of units in ending inventory | Cost per unit | Ending Inventory | |
| Beginning inventory | not attempted | not attempted | |||||||
| Purchases: | |||||||||
| March 14 | not attempted | not attempted | |||||||
| July 30 | not attempted | not attempted | |||||||
| October 26 | not attempted | not attempted | |||||||
| Total | 0 | $0 | 0 | $0 | 0 | $0 | |||
| c) Gross Margin | FIFO | LIFO | |||||||
| not attempted | not attempted | not attempted | |||||||
| not attempted | not attempted | not attempted | |||||||
In: Accounting
Barnes Company uses a job order cost system. The following data summarize the operations related to production for October:
| October | 1 | Materials purchased on account, $635,470. |
| 2 | Materials requisitioned, $628,070, of which $74,070 was for general factory use. | |
| 31 | Factory labor used, $674,350, of which $94,570 was indirect. | |
| 31 | Other costs incurred on account for factory overhead, $151,200; selling expenses, $228,420; and administrative expenses, $152,810. | |
| 31 | Prepaid expenses expired for factory overhead were $27,820; for selling expenses, $28,010; and for administrative expenses, $18,240. | |
| 31 | Depreciation of office building was $81,480; of office equipment, $43,370; and of factory equipment, $31,020. | |
| 31 | Factory overhead costs applied to jobs, $363,480. | |
| 31 | Jobs completed, $992,960. | |
| 31 | Cost of goods sold, $885,860. |
| Required: | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Journalize the entries to record the summarized operations. Refer to the chart of accounts for the exact wording of the account titles. CNOW journals do not use lines for spaces or journal explanations. Every line on a journal page is used for debit or credit entries. Do not add explanations or skip a line between journal entries. CNOW journals will automatically indent a credit entry when a credit amount is entered. |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| CHART OF ACCOUNTS | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Barnes Co. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| General Ledger | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
In: Accounting
In: Accounting
A survey conducted for the Northwestern National Life Insurance Company revealed that 70% of American workers say job stress caused frequent health problems. One in three said they expected to burn out in the job in the near future. Thirty-four percent said they thought seriously about quitting their job last year because of work-place stress. Fifty-three percent said they were required to work more than 40 hours a week very often or somewhat often. a. Suppose a random sample of 10 American workers is selected.What is the probability that more than seven of them say job stress caused frequent health problems? What is the expected number of workers who say job stress caused frequent health problems? b. Suppose a random sample of 15 American workers is selected. What is the expected number of these sampled workers who say they will burn out in the near future? What is the probability that none of the workers say they will burn out in the near future? c. Suppose a sample of seven workers is selected randomly. What is the probability that all seven say they are asked very often or somewhat often to work more than 40 hours a week? If this outcome actually happened, what might you conclude?
In: Statistics and Probability
Airbus sold an aircraft, A400, to Delta Airlines, a U.S. company, and billed $30 million payable in six months. Airbus is concerned with the euro proceeds from international sales and would like to control exchange risk. The current spot exchange rate is $1.05/€ and six-month forward exchange rate is $1.10/€ at the moment. Airbus can buy a six-month put option on U.S. dollars with a strike price of €0.95/$ for a premium of €0.02 per U.S. dollar. Currently, six-month interest rate is 2.5% in the euro zone and 3.0% in the U.S.
In: Accounting
In: Economics
Instructions: Answer any ONE of the following essay questions. Your response should be in essay format. Write as much as possible telling me who, what, where, when, and why. Use complete sentences and multiple paragraphs; 3-5-7 total. Your response is worth up to 20 points.
Discuss American foreign policy in the 1970s under President Richard Nixon. What was his strategy for the Cold War? Did he do things different or were his efforts similar to his predecessors? Was he successful, why, or why not? How did the American people react to his policies? Be detailed and provided examples.
-OR-
Discuss the debate over Global Warming during the 1990s. What is meant by Global Warming? What exactly is the debate? What are the arguments from each side? Who is winning this debate? How does this debate affect the American people? Be detailed and provided examples.
-OR-
Discuss the September 11th attacks on the World Trade Center in New York in 2001. What were they and who led them? For what purpose were these attacks coordinated? Who did they U.S. ultimately determine was responsible for this act? What was the U.S.’s response to the attacks? Was the U.S. successful, why, or why not? Be detailed and provided examples.
In: Psychology
Midlife—Making the Most of the “Second Half”
Have you heard the saying, “Life begins at forty?” Unfortunately the cultural messages we receive about midlife are often negative (an emphasis on the development of wrinkles and gray hair, for example) rather than positive (a time of advancement in one’s career, freedom from the responsibilities of caring for young children). Midlife is often a time of transition. People may change careers or end long-term marriages as they assess where they are in life and how they would like to spend the remainder of their lives. Because these transitions are sometimes painful, the concept of the “midlife crisis” has been created and has become popular in American culture. However, there has also been some debate questioning whether the midlife crisis is a universal experience and, in fact, whether it even exists. Review research on the concept of the midlife crisis and draw your own conclusions about its existence and prevalence in American culture. You will also discuss some ways that we can create a more positive image of midlife.
What is the evidence for the existence of the midlife crisis?
Why has the concept become so pervasive in American culture?
Discuss at least two ways that we can create a more positive image of midlife in our culture.
In: Psychology