Write a function named "replacement" that takes a string as a parameter and returns an identical string except with every instance of the character "w" replaced with the character "v"
My code:
function replacement(word){
var str=word;
var n=str.replace("w","v");
return n;
}
Syntax Error: function replacement incorrect on input
Not sure how to fix? Can't use a loop for answer
In: Computer Science
Suppose we are given an arbitrary digraph G = (V, E) that may or may not be a DAG. Modify the topological ordering algorithm so that given an input G, it outputs one of the two things:
a. A topological ordering thus establishing that G is a DAG.
b. A cycle in G thus establishing that it is not a DAG.
The runtime of your algorithm should be O(m+n) where m = |E| and n = |V|
In: Computer Science
Write a program that prompts the user for a file name, make sure the file exists and then reads through the file, counts the number of times each word appears and outputs the word count in a sorted order from high to low.
The program should:
the - 7
in - 6
to - 5
and - 4
of - 4
File Name: NYT2.txt
File Content:
Fact-Checking Trump’s Orlando Rally: Russia, the Wall and Tax Cuts President Trump delivered remarks in Florida in a formal start to his re-election effort. Deutsche Bank Faces Criminal Investigation for Potential Money-Laundering Lapses Federal authorities are focused on whether the bank complied with anti-money-laundering laws, including in its review of transactions linked to Jared Kushner. Five NY1 Anchorwomen Sue Cable Channel for Age and Gender Discrimination The women, including Roma Torre, say their careers were derailed after Charter Communications bought New York’s hometown news station in 2016. Hypersonic Missiles Are Unstoppable. And They’re Starting a New Global Arms Race. The new weapons — which could travel at more than 15 times the speed of sound with terrifying accuracy — threaten to change the nature of warfare. Nxivm’s Keith Raniere Convicted in Trial Exposing Sex Cult’s Inner Workings Mr. Raniere set up a harem of sexual “slaves” who were branded with his initials and kept in line by blackmail. Jamal Khashoggi Was My Fiancé. His Killers Are Roaming Free. Washington hasn’t done enough to bring the murdered Saudi columnist’s killers to justice.
In: Computer Science
1. Adverse selection may result in both the low risk and the high risk people in a population being left uninsured. Is this, in itself, a market failure?
| Yes, for the low risk group, but not for the high risk group. |
| Yes, for the high risk group, but not for the low risk group. |
| No, this is not a market failure on its own--there is no market failure unless positive exernalities in the use of health care exist. |
| No, this is just how markets work--only those willing and able to pay the price can buy a product.. |
Question 2
Which of the following statements is FALSE?
| A deductible is an amount of money that an insured person must pay out-of-pocket before their insurance starts to pay for any health care. |
| The elderly are the best insured age group in the U.S.A. |
| A risk averse person would never buy actuarially fair health insurance. |
| Insurers have used pre-existing conditions in practicing Adverse Selection. |
Question 3
Which of the following are examples of Adverse Selection in the market for health insurance?
(i) Insurers rejecting high cost customers;
(ii) People with low expected health care costs choosing to not buy insurance;
(iii) Uninsured people delaying seeking treatment until it is an emergency;
(iv) Insurers refusing to renew policies of sick people;
(v) Insurers imposing lifetime limits on how much health care they will pay for each person.
| (i), (ii), (iv), and (v), only. |
| (i), (iv), and (v), only. |
| (i) and (ii), only. |
| All of (i), (ii), (iii), (iv), and (v). |
Question 4
Which of the following are possible government solutions to the various types of adverse selection in the market for health insurance?
(i) Require doctors to have a license to practice medicine;
(ii) Make it mandatory for everyone to have health insurance;
(iii) Impose regulations on private insurance companies;
(iv) Provide health insurance for the full population, paying for it through taxation;
(v) Provide health care by owning hospitals, employing doctors, and purchasing health care resources, all financed through taxation.
| All of (i), (ii), (iii), (iv), and (v). |
| (ii), only. |
| (ii), (iii), (iv), and (v), only. |
| (iii), (iv), and (v), only. |
Question 5
Which of the following statements is FALSE?
| The purpose of health insurance is to protect individuals from predictable, recurring, low-level costs, like preventive care. |
| Low risk people choosing to drop out of the market, increases the premiums that must be charged to those remaining in the insurance pool. |
| Risk pooling enables an insurer to spread risks across everyone in the insurance pool. |
| Adverse selection of low risk people is the result of Asymmetric Information. |
In: Economics
As a medical professional, we will often be tasked with presenting a diagnosis to a patient with no educational background or experience within the healthcare profession. In these cases, it is critical to convey this very important and pertinent information to the patient in a way in which they can fully understand the information, i.e., to put the information into laymen terms, as well as making certain the patient is comfortable in seeking additional support and community.
In addition, patients in the above scenario might also choose to
seek out the help of a healthcare advocate (a medical professional
appropriately trained within the medical field) to help the patient
research, organize, understand and communicate and field questions
with the physician. Patient healthcare advocates require that the
information is conveyed and presented to them as if the physician
and/or healthcare professional were speaking to a colleague, i.e.,
medical and technical terms.
Assume the role of a healthcare professional tasked with educating
both the newly diagnosed patient (in laymen terms), as well as the
patient’s healthcare advocate (medical and technical
terms).
Instructions:
v Choose one cranial nerve injury or disease OR one spinal nerve injury or disease to serve as the focus of the assignment.
v Complete research on the selected injury or disease.
v Create an educational pamphlet for the patient that includes the following information on the injury or disease in laymen terms:
o Anatomy
o Physiological processes/pathways
o Risk factors
o Signs and symptoms
o When to call the primary care provider or seek emergency room attention
o Current and potential treatments (to include existing clinical trials)
o Prevention strategies and measures
o Online and community resources for further information and support
v Create an educational pamphlet for the patient’s healthcare advocate that includes the following information on the injury or disease in medical and technical terms:
o Anatomy
o Physiological processes/pathways
o Risk factors
o Signs and symptoms
o When to call the primary care provider or seek emergency room attention
o Current and potential treatments (to include existing clinical trials)
o Prevention strategies and measures
o Online and community resources for further information and support
v Be creative with the design and writing of each piece to make the information engaging and understandable for the patient and medically and technically appropriate for the patient’s healthcare advocate.
v Please be certain to cite any relevant information from sources used within your materials (to include photos and diagrams) in APA format.
v Please review the rubric to ensure that your assignment meets criteria.
v Unit 6: Educational Pamphlet
In: Nursing
Activity 1: How far can a soccer player kick a soccer ball down field? Through the application of a linear function and a quadratic function and ignoring wind and air resistance one can describe the path of a soccer ball. These functions depend on two elements that are within the control of the player: velocity of the kick (v k ) and angle of the kick (?). A skilled high school soccer player can kick a soccer ball at speeds up to 50 to 60 mi/h, while a veteran professional soccer player can kick the soccer ball up to 80 mi/h. Vectors Gravity The vectors identified in the triangle describe the initial velocity of the soccer ball as the combination of a vertical and horizontal velocity. The constant g represents the acceleration of any object due to Earth’s gravitational pull. The value of g near Earth’s surface is about ?32 ft/s2 . v x = v k cos ? & v y = v k sin ?
1. Use the information above to calculate the horizontal and vertical velocities of a ball kicked at a 35° angle with an initial velocity of 60 mi/h. Convert the velocities to ft/s. (2 pts) Project 2 368 MTHH 039 2. The equations x(t) = v x t and y(t) = v y t + 0.5 gt2 describe the x- and y- coordinate of a soccer ball function of time. Use the second to calculate the time the ball will take to complete its parabolic path. (4 pts) 3. Use the first equation given in Question 2 to calculate how far the ball will travel horizontally from its original position. (2 pts)
Activity 2: How far can a soccer player kick a soccer ball down field? Through the application of a linear function and a quadratic function and ignoring wind and air resistance one can describe the path of a soccer ball. These functions depend on two elements that are within the control of the player: velocity of the kick (v k ) and angle of the kick (?). A skilled high school soccer player can kick a soccer ball at speeds up to 50 to 60 mi/h, while a veteran professional soccer player can kick the soccer ball up to 80 mi/h.
1. Use the technique developed in Activity 1 to calculate horizontal distance of the kick for angle in 15° increments from 15° to 90°? Make a spreadsheet for your calculations. Use the initial velocity of 60 mi/h. (8 pts)
I want to know the answer of the last question that I write bold and italic. Let me know the answer of this questions!!!
In: Math
14. 8. Read the story below from NPR and then identify the very important concept . How does it relate to correlation and Chi-Square
Analysis Finds Geographic Overlap In Opioid Use And Trump Support In 2016
June 23, 20188:02 AM ET
Paul Chisholm, NPR
In 2016, Donald Trump captured 68 percent of the vote in West Virginia, a state hit hard by opioid overdoses.
BRENDAN SMIALOWSKI/AFP/Getty Images
The fact that rural, economically disadvantaged parts of the country broke heavily for the Republican candidate in the 2016 election is well known. But Medicare data indicate that voters in areas that went for Trump weren't just hurting economically — many of them were receiving prescriptions for opioid painkillers.
The findings were published Friday in the medical journal JAMA Network Open. Researchers found a geographic relationship between support for Trump and prescriptions for opioid painkillers.
It's easy to see similarities between the places hardest hit by the opioid epidemic and a map of Trump strongholds. "When we look at the two maps, there was a clear overlap between counties that had high opioid use ... and the vote for Donald Trump," says Dr. James S. Goodwin, chair of geriatrics at the University of Texas Medical Branch in Galveston and the study's lead author. "There were blogs from various people saying there was this overlap. But we had national data."
Goodwin and his team looked at data from Census Bureau, the 2016 election and Medicare Part D, a prescription drug program that serves the elderly and disabled.
To estimate the prevalence of opioid use by county, the researchers used the percentage of enrollees who had received prescriptions for a three-month or longer supply of opioids. Goodwin says that prescription opioid use is strongly correlated with illicit opioid use, which can be hard to quantify.
"There are very inexact ways of measuring illegal opioid use," Goodwin says. "All we can really measure with precision is legal opioid use."
Goodwin's team examined how a variety of factors could have influenced each county's rate of chronic opioid prescriptions. After correcting for demographic variables such as age and race, Goodwin found that support for Trump in the 2016 election closely tracked opioid prescriptions.
In counties with higher-than-average rates of chronic opioid prescriptions, 60 percent of the voters went for Trump. In the counties with lower-than-average rates, only 39 percent voted for Trump.
A lot of this disparity could be chalked up to social factors and economic woes. Rural, economically-depressed counties went strongly for Trump in the 2016 election. These are the same places where opioid use is prevalent. As a result, opioid use and support for Trump might not be directly related, but rather two symptoms of the same problem – a lack of economic opportunity.
To test this theory, Goodwin included other county-level factors in the analysis. These included factors such as unemployment rate, median income, how rural they are, education level, and religious service attendance, among others.
These socioeconomic variables accounted for about two-thirds of the link between voter support for Trump and opioid rates, the paper's authors write. However, socioeconomic factors didn't explain all of the correlation seen in the study.
"It very well may be that if you're in a county that is dissolving because of opioids, you're looking around and you're seeing ruin. That can lead to a sense of despair," Goodwin says. "You want something different. You want radical change."
For voters in communities hit hard by the opioid epidemic, the unconventional Trump candidacy may have been the change people were looking for, Goodwin says.
Dr. Nancy E. Morden, associate professor at the Dartmouth Institute for Health Policy and Clinical Practice, agrees. "People who reach for an opioid might also reach for ... near-term fixes," she says. "I think that Donald Trump's campaign was a promise for near-term relief."
Goodwin's study has limitations and can't establish that opioid use was a definitive factor in how people voted.
"With that kind of study design, you have to be cautious in terms of drawing any causal conclusions," cautions Elene Kennedy-Hendricks, an assistant scientist in the Department of Health Policy and Management at the Johns Hopkins Bloomberg School of Public Health. "The directionality is complicated."
Goodwin acknowledges that the study has shortcomings.
"We were not implying causality, that the Trump vote caused opioids or that opioids caused the Trump vote," he cautions. "We're talking about associations."
Still, the study serves as an interesting example highlighting the links between economic opportunity, social issues and political behavior.
"The types of discussions around what drove the '16 election, and the forces that were behind that, should also be included when people are talking about the opioid epidemic," Goodwin says.
In: Statistics and Probability
Write the non modular version of this solution. Start with the implementation provided in proj6-sequentialMain2.cpp and implement the functionality found in proj6-modularMain2.cpp. Name your source code proj6-sequentialMain3.cpp
proj6-sequentialMain2.cpp:
int main() {
string name;
int age;
string choice = "yes";
while( choice != "no" ) {
cout << "What is your name? " << endl;
getline( cin, name );
cout << “How old are you? " << endl;
cin >> age;
cout << "Your name is: " << name << endl;
cout << "You are " << age << “ years old” << endl;
cout << "Do you want to read in another person (yes/no)? " << endl;
cin >> choice;
cin.ignore(3, '\n');
}
return 0;
}
proj6-modularMain2.cpp:
void readPerson( istream &in, string &name, int &age ) {
getline( in, name );
in >> age;
in.ignore(3, '\n');
}
void requestInfo( ostream &out ) {
out << "Please enter your name followed by your age." << endl;
}
void writePerson( ostream &out, string name, int age ) {
out << name << endl;
out << age << endl;
}
string readAgain( ostream &out, istream &in ) {
string choice;
out << "Do you want to read in another person (yes/no)? " << endl;
in >> choice;
in.ignore(3, '\n');
return choice;
}
int main() {
string name, choice;
int age;
bool fileRead = false;
ifstream pfile;
ofstream opfile;
cout << "Would you like to read the data from a file? " << endl;
cin >> choice;
cin.ignore(3, '\n');
if( choice == "yes" ) {
fileRead = true;
pfile.open("iperson.txt");
if( !pfile ) {
cerr << "Can't open person.txt for read." << endl;
return 1;
}
}
opfile.open("operson.txt");
choice = "yes";
if( fileRead ) {
readPerson( pfile, name, age );
if( !pfile ) {
choice = "no";
}
}
while( choice != "no" ) {
if( !fileRead ) {
requestInfo( cout );
readPerson( cin, name, age );
}
writePerson( opfile, name, age );
if( !fileRead ) {
choice = readAgain( cout, cin );
} else {
readPerson( pfile, name, age );
if( !pfile ) {
choice = "no";
}
}
}
if( fileRead ) {
pfile.close();
}
opfile.close();
return 0;
}In: Computer Science
Story: The wide lens approach: Fixing the Blindspot
My organization implemented check-in kiosk to eliminate wait time in long lines. However, the problem is that the younger generation uses the kiosk more than the older generation?
The older generation prefers to wait in line. How do we fix the blind spot using Adner Strategy for Innovation?
Adner, R. (2013). The Wide Lens: A New Strategy for Innovation. London; Penguin Books. p. 219-229. ISBN 9781591846291
What would Adner: The Wide Lens author say to fix the problem of the older generation continuing to wait in line and avoiding the use of the kiosk?
In: Nursing
How and why do big cities attract big companies?
After reading "New Geography of Jobs" Forces of Attraction, it is very interesting as to why big cities like New York, Boston, San Francisco attract so many big companies to set their bases there. I share the confusion with the author, most companies in big cities have to pay higher wages to their employees because the expenditures for living is higher. It's not like you're going to get any information about your competitors if you set right beside them. Maybe there is a magical reason as to why these places attract big companies.
In: Economics