Write a program that creates a file called "data.dat" in the current directory. Prompt the user for five numbers, and write them, one at a time, on both the screen and into the file. Close the file, then open it again for reading only, and display the contents on the screen. Handle error conditions that may occur.
Please Need this to be done in PERL. Thanks
In: Computer Science
In: Accounting
What is the impact of The Opioid Crisis in America?
In: Economics
Communicate effectively on the topic of healthcare in America.
In: Operations Management
The list of individuals from which a sample is actually selected is called the sampling frame. Ideally, the sampling frame should list every individual in the population, but in practice this is often difficult. A sampling frame that leaves out part of the population is a common source of undercoverage. In the following questions select all choices that apply; to receive credit for the question you must select all the correct choices and only the correct choices.
Question 1. A pollster wants to select a random sample of households in a particular community. The pollster randomly selects a sample of households in the community from the community telephone directory available in the public library. What households are omitted from this sampling frame?
1Households that connect to the internet with their phone line.
2Households that possess only cellphones Households with a second line for the fax machine.
3Households that have moved into the community since the most recent community telephone directory was printed.
4Households with unlisted numbers. Households with more than one line. Poor households (cannot afford a phone)
5Households without telephones.
Question 2. What types of people do you think are most likely to live in the omitted households selected in question 1?
1These people will probably be underrepresented in the sample. lower income people (cannot afford a phone)
2people who choose not to list their numbers people who choose not to have phones
3people who graduated from UNC-Chapel Hill
4jobless people who have moved into the community to look for employment since the most recent community telephone directory was printed
5people who drive hybrid automobiles high income people
Question 3. It is usual in telephone surveys to use random dialing equipment that selects the last four digits of a telephone number at random after being given the land-line exchange (the first three digits; note that cell phone exchanges differ from land-line exchanges). Which of the households you selected in Question 1 above will be included in this sampling frame by random digit dialing?
1Households that possess only cellphones Poor households (cannot afford a phone)
2Households with unlisted numbers
3Households without telephones
4Households with land-line telephones that have moved into the community since the most recent community telephone directory was printed.
In: Statistics and Probability
Question 5
0/1 point (graded)
The following is the full path to a homework assignment file called "assignment.txt": /Users/student/Documents/projects/homeworks/assignment.txt.
Which line of code will allow you to move the assignment.txt file from the “homeworks” directory into the parent directory “projects”?
mv assignment.txt
mv assignment.txt .
mv assignment.txt ..
mv assignment.txt /projects incorrect
Answer
Incorrect:
Try again. This code does not provide enough information about where to move the file. You need to specify a relative or full path to the location where you want to move the file to.
Question 9
0/1 point (graded)
The source function reads a script from a url or file and evaluates it. Check ?source in the R console for more information.
Suppose you have an R script at ~/myproject/R/plotfig.R and getwd() shows ~/myproject/result, and you are running your R script with source('~/myproject/R/plotfig.R').
Which R function should you write in plotfig.R in order to correctly produce a plot in ~/myproject/result/fig/barplot.png?
ggsave('fig/barplot.png'), because this is the relative path to the current working directory.
ggsave('../result/fig/barplot.png'), because this is the relative path to the source file ("plotfig.R"). incorrect
ggsave('result/fig/barplot.png'), because this is the relative path to the project directory.
ggsave('barplot.png'), because this is the file name.
Question 12
1 point possible (graded)
Which of the following meanings for options following less are not correct?
(Hint: use man less to check.)
-g: Highlights current match of any searched string
-i: case-insensitive searches
-S: automatically save the search object
-X: leave file contents on screen when less exits.
Question 13
1 point possible (graded)
Which of the following statements is incorrect about preparation for a data science project?
Select ALL that apply.
Always use absolute paths when working on a data science project.
Saving .RData every time you exit R will keep your collaborator informed of what you did.
Use ggsave to save generated files for use in a presentation or a report.
Saving your code in a Word file and inserting output images is a good idea for making a reproducible report.
In: Computer Science
1.Historians divide Colonial America into three distinct regions. Compare and contrast these three different areas and discuss why each region developed in a unique way.
2. Compare and contrast the society that developed in Colonial America with European society at this same time. What historical factors might explain the differences between the two societies?
3. indentured servant
In: Chemistry
Amanda keeps bees to produce honey. Each hive produces $350 worth of honey each month. The table below shows Amanda’s marginal cost of tending each bee hive and her private marginal benefit, which is equal to the market value of the honey each hive produces.
Marginal Cost and Marginal Benefit
| Quantity (hives) | MCprivate | MBprivate | MBexternal | MBsocial |
| 1 | $50 | $350 | $ | $ |
| 2 | 150 | 350 | ||
| 3 | 250 | 350 | ||
| 4 | 350 | 350 | ||
| 5 | 450 | 350 |
Instructions: Enter your answers as a whole number.
a. What is "private quantity" of hives for Amanda to
tend?
hive(s)
Now suppose that each of Amanda’s bee hives also provides pollination services to surrounding farms and that these services are worth $100 per hive per month.
b. Fill in the external marginal benefit (MBexternal) and the social marginal benefit (MBsocial) columns in the table above.
c. What is the socially efficient number of hives for Amanda to tend if all costs and benefits are considered?
hive(s)
In: Economics