Questions
Using Virtualbox in Debian, write a simple program (a single .cpp file) in Linux shell C++...

Using Virtualbox in Debian, write a simple program (a single .cpp file) in Linux shell C++

Rules:

-Use fork(), exec(), wait(), and exit()

_______________________________________________________________________________________________________________________________________________

-A line of input represents a token group.

-Each token group will result in the shell forking a new process and then executing the process.

e.g. cat –n myfile.txt // a token group

-Every token group must begin with a word that is called the command(see example above). The words immediately following a command are calledarguments(e.g. there are two arguments for the catcommand above).A command may be followed bynone, one, or more argumentsas the command allows to have.

_______________________________________________________________________________________________________________________________________________

Shell Commands To Test:

ls: a token group containing one token(i.e.a command)

ls -l: a token group containing two tokens (i.e.a command and an argument)

sort infile: a tokengroup containingtwo tokens (i.e.acommand and an argument)

dir: a token group containingonly one token (i.e.a command)

sort –dinfile: atoken group containingthree tokens (i.e.a command and two arguments)

cat infile: a token group containing two tokens (i.e.a command and an argument)

Lines of input are interpreted once their tokens are correctly extracted.Your shell should first print a # sign to the screen representing a prompt and wait there until the user types in a command. Your shell then spawns a child process to carry out the command.When yourshell finishes processingthe current line, it prints a # sign again to the screen waiting for the user to type in another command.This process is repeated until the user presses Ctrl-C to terminate your shell.

-Every command is to be interpreted as a valid Linux executable to be executed.

-All commands are assumed to be in the current directory.

-After interpreting a command, the shell should wait for the forked processto terminate before processingthe next line of input.

The program should be able to extract tokens from each input line entered by the user. If you have problems with extracting tokens from input lines, you may use the C++ library function strtok() to do it.

In: Computer Science

Read the following case study: Swan is a 14-year-old student at the Sea-Cow School for the...

Read the following case study:

Swan is a 14-year-old student at the Sea-Cow School for the Performing Arts. Her goal in life is to be a world-acclaimed ballet dancer. She has been dancing ever since she was 4 years old, when her parents enrolled her in a Ballet for Tots program. Swan’s parents have always encouraged her to pursue her dream of dancing professionally. As a young girl, Swan had the perfect body for a ballet dancer, slim and flexible. Within the last year, Swan has become concerned that she is gaining weight. She heard from friends that smoking cigarettes could help her stay thin, although she didn’t exactly know why. Swan became desperate to control her weight and started borrowing cigarettes from friends. Eventually, she was smoking almost a pack of cigarettes a day and felt edgy and irritable if she went without smoking for more than a few hours. She thought about trying diet pills or even barbiturates to avoid the smell of the cigarette smoke.

Then refer to the following toolkit for parents: "National Eating Disorder Association: Parent ToolKit"

https://www.nationaleatingdisorders.org/sites/default/files/Toolkits/ParentToolkit.pdf


Using the above toolkit, along with Chapter 5, and the materials from the field trip, compose a 300-word post that responds to the following questions:

Swan’s parents have approached you, the school counselor, because they found rolling papers in her room. Although Swan denies using any other drugs, her parents are convinced that she has been smoking marijuana.

How would you approach this as case as a school counselor?
Do you think Swan is addicted or at risk for addiction? (If yes, which ones, and why?)
What questions would you ask Swan and her parents?
What recommendations would you make?

In: Psychology

CH 7: Entrepreneurship Case BBG 101 -- Hart One of the biggest challenges for entrepreneurs is...

CH 7: Entrepreneurship Case BBG 101 -- Hart

One of the biggest challenges for entrepreneurs is getting the word out about their new venture. Perhaps that's why entrepreneurs have embraced social media as a communication tool.

If used skillfully, many believe, social media can help level the playing field between small businesses and their giant competitors. David avRutick, co-owner of Folbot, a small kayak retailer, claims that without Twitter, he wouldn't have as many sales as he does. “You can't buy that kind of exposure,” avRutick says.

Folbot competes against such household names as L.L. Bean and Cabela's—there's no way the smaller company could challenge the larger ones without widespread interactive communication. However, critics point out that social media sites vary widely in their value to small businesses. “The hype right now exceeds the reality,” observes Larry Chiagouris, a professor of marketing at Pace University's Lubin School of Business.

Despite the fact that the use of social media by firms with fewer than 100 employees doubled in one recent year, only 22 percent of those who responded to a separate survey reported a direct increase in profits as a result of social media use, while half said they broke even on the investment. Others caution that social media networking eats up valuable time, particularly for entrepreneurs whose day is chock-full of tasks ranging from design to distribution and manufacturing to marketing.

Most entrepreneurs support the use of social media, but with moderation. Chris Lindland, owner of Cordarounds.com, an online clothing retailer, advises patience. “My business has been visited millions of times, but I haven't made millions of sales,” he comments. But he believes patience pays off.

Questions for Critical Thinking

How will social networking change the business environment for entrepreneurs?

How might entrepreneurs use social media to secure financing?

In: Operations Management

Assess the Impact of Globalisation What are the advantages and disadvantages of each? Globalization has many...

Assess the Impact of Globalisation

  1. What are the advantages and disadvantages of each?

Globalization has many advantages and disadvantages to each type of globalization that exists. The most common when globalization is being discussed is economic globalization, which deals with the impact of globalization on countries economy. One advantage to economic globalization is increased competition. Increased competition is great for countries especially those that are newer to the global economy as it helps them to identify themselves in the economy and encourages aggressive growth. A second important advantage is the spread of technology and innovation that businesses are able to share with one another. This is a crucial component to the global economy as technology enables economies to be global in the first place. Without the correct infrastructure, technology and innovation, it is impossible for a country to remain connected to the global economy and other countries. A third advantage to economic globalization is the development of higher standards of living for society in countries that are on the rise for globalization. An example of this would be India where their economy has really taken off in the last 10-15 years. India has really made a mark in the global economy in the information technology sector. As a result, India has become a key player in the global economy, which has significantly helped improve their workforce, society, and products/services that it offers. One disadvantage that economic globalization offers is the contribution to cultural homogeneity or creating a monoculture. The thought is that if countries continue to adapt the same trends and global ideologies, there will be a loss of culture and identity for countries. While having similar views across the world can be a uniting function across different cultures, it can also contribute to the creation of a monoculture; which means less of a unique identity for countries in the global space. A second disadvantage of economic globalization is that large corporations gain more power. Think about a really large company like Google where they are in more than 50 countries throughout the world. Moreover, it’s parent company, Alphabet, is in more than 70 countries throughout the world.

Provide a 300 word response

In: Economics

Consider the following scenario. Carole is an animal-rights activist who owns a sanctuary called Large Cat...

Consider the following scenario. Carole is an animal-rights activist who owns a sanctuary called Large Cat Rescue, while Joe owns a zoo called Tiger Kingdom. There is an ongoing feud between them with Carole alleging abuse of animals in Tiger Kingdom while Joe counteracts with similar accusations about Large Cat Rescue. In a recent escalation of this feud, Carole sues Joe for making defamatory comments about her personal life on a social media forum called Rumorville. Five weeks from now a judge will decide whether or not Joe is guilty. If found guilty Joe will be ordered to pay $4 million in damages to Carole; if not, there will be no payment. However, Carole and Joe can settle out of court in the four weeks prior to the hearing, in which case they do not go to court in Week 5. The negotiation for settlement proceeds as follows. In each week ?? ∈ {1, 2,3, 4} Carole or Joe can make a settlement offer St and the other party has to decide whether to accept it. Carole and Joe take turns making offers; Carole makes offers in weeks 1 and 3, while Joe gets his turn in weeks 2 and 4. If the offer is accepted in any particular week, the game ends and Joe pays St (the amount decided in week t) to Carole. Carole is risk-averse and her utility from receiving payment x is (x)1/2. She does not discount future payoffs and does not incur any costs of negotiation for going to court. Joe, however, is riskneutral and needs to pay a small fee c > 0 to lawyers for every week the negotiations take place. Use backward induction to analyse the above scenario. For the purpose of your analysis you may assume a probability p=0.7 of Carole winning the court case if the negotiations are not settled.

word limit 1500-2000

In: Economics

In this program: ================================================================== /* Program to count number of occurrences of a given string in...

In this program:

==================================================================


/* Program to count number of occurrences of a given string in original string*/

#include <iostream>
#include <cstring>
#include <stdio.h>
#include <iostream>

using namespace std;

int main()
{

const int SIZE = 40;
char str[SIZE];
char str1[SIZE];
char searchString[SIZE];
int n;
int l1, l2;
int count = 0;

printf("Enter a sentence: \n");
fgets(str,SIZE,stdin);

printf("Enter a search word: \n");
fgets(searchString,SIZE,stdin);

if (str1[strlen(str1) - 1] == '\n')
{
str1[strlen(str1)-1] = '\0';
}
if (str[strlen(str) - 1] == '\n')
{
str[strlen(str)-1] = '\0';
}
if (searchString[strlen(searchString) - 1] == '\n')
{
searchString[strlen(searchString)-1] = '\0';
}


printf("\n");

//Original string is contained in str

l1 = strlen(str);
l2 = strlen(searchString);

for(int i = 0; i < l1 - l2 +1; i++)
{

//Using strstr all the occurences are counted through iterating each successive location in the original string
if(strstr(str + i, searchString) == str + i)
{

//When search string is found in original string, count is increased and original string location to search is moved to the length of search string to find next occurences
count++;
i = i + l2 -1;
}
}

cout << "Found "<< count << " words of "<< searchString<<" in: \n" << str;

return 0;
}

=============================================================================

can someone explain to me what is going in in this loop i am so lost...The only thing i understand is the count++;

The part im having trouble understanding is why:

i < l1 - l2 +1   and also   strstr(str + i, searchString) == str + i (like why the '+ i')      and also why    i = i + l2 -1;

for(int i = 0; i < l1 - l2 +1; i++)
{
if(strstr(str + i, searchString) == str + i)
{
count++;
i = i + l2 -1;
}

In: Computer Science

CASE Study : Soltis & Sons is a management consulting firm that is attempting to grow...

CASE Study :

Soltis & Sons is a management consulting firm that is attempting to grow its business by targeting small businesses that are run by women or immigrants. In pursuing this strategy, the company has hired employees of other cultures whose first language is not English. Many of these employees are under 30 and they do not have college degrees. While this effort is leading to a workforce that mirrors the clients, the company finds that employees and managers are experiencing difficulties communicating with one another. This leads to misunderstandings and a decrease in productivity and customer satisfaction. For example, if a manager gives instructions about completing a certain task to an employee who fails to fully comprehend the instructions, the employee may make mistakes.

The director of Human Resources is considering whether or not to offer some type of training, yet none has been offered to date. She thinks some employees may be

impacted by negative stereotypes associated with a lack of work experience with people from different cultures. She also noted that some work teams do not like to be

supervised by younger people of color. A few employees quit over this issue and management is trying to decide what to do.

Using the 3-Step Problem-Solving Approach and the Organizing Framework, how can Soltis & Sons address the problem?

Step 1: Define the problem. What are the gaps between the desired outcomes and the current state?

Step 2: Identify causes of the problem. Remember, the diversity climate is an important situation factor. There are also relevant processes across the individual

level (perception, attributions, and psychological safety), the group/team level (group/team dynamics), and the organizational level (options to manage diversity).

These inputs and processes have critical outcomes.

Step 3: Make recommendations for solving the problem. What options does Soltis & Sons have?

Word count should be more than 600 words( total of 3 steps ) .

Please help me !! Thank You.

In: Operations Management

Analyze each stress situation by applying the components of the ABC-X Model. (A=Stressor, the thing that's...

Analyze each stress situation by applying the components of the ABC-X Model. (A=Stressor, the thing that's causing the stress, life events that result in or require a family to change, B=Resources, things that can help them take care of the stress, internal or external and range from tangible (money, education/degrees earned) to intangible (social support systems), C=Perception, how the family is perceiving the stress, (1) How does the family view or define the problem? and (2) What is their understanding of the situation that resulted in the problem?, X=Crisis, when a family cannot put the stress event into perspective in a way that lets them manage it effectively)

SCENARIO #3—The Jones Family David and Stacy have been living in a small town where David is employed with a local law firm. If David keeps progressing as he has, he’s expected to be named a partner in the near future. David has been working for the firm for several years and has been able to support Stacy while she pursues her medical degree at the local university. Stacy is one year from graduating with her degree, and she must decide where to go for her residency. She receives word from her top choice—Healthy Hospital—that she has been accepted for their residency program. However, Healthy Hospital is 800 miles away. She and David have to decide what to do. They know that they don’t want to spend four years apart, but neither one wants to give up on their goals.

Be sure to identify the A, B, C & X in each scenario

In some of the descriptions, it may not be clear as there could be multiple factors influencing the family. You can create "hypothetical" explanations for the possible A, B, C & X.

Discuss how communication can contribute to the reduction or resolution of the stressful situation experienced in each of the scenarios.

What recommendations would you offer to family members to resolve the impact of the stress? (not really Psychology but it's the closest subject)

In: Psychology

Sam Strother and Shawna Tibbs are senior vice presidents of Mutual of Seattle. They are co-directors...

Sam Strother and Shawna Tibbs are senior vice presidents of Mutual of Seattle. They are co-directors of the company's pension fund management division, with Strother having responsibility for fixed income securities (primarily bonds) and Tibbs responsible for equity investments. A major new client, the Northwestern Municipal Alliance, has requested that Mutual of Seattle present an investment seminar to the mayors of the cities in the association, and Strother and Tibbs, who will make the actual presentation, have asked you to help them. To illustrate the common stock valuation process, Strother and Tibbs have asked you to analyze the Temp Force Company, an employment agency that supplies word processor operators and computer programmers to businesses with temporarily heavy workloads. You are to answer the following questions.

a. Describe briefly the legal rights and privileges of common stockholders.

b. (1) Write out a formula that can be used to value any stock, regardless of its dividend pattern. (2) What is a constant growth stock? How are constant growth stocks valued? (3) What happens if a company has a constant g that exceeds its rs? Will many stocks have expected g > rs in the short run (i.e., for the next few years)? In the long run (i.e., forever)?

c. Assume that Temp Force has a beta coefficient of 1.2, that the risk-free rate (the yield on T-bonds) is 7.0%, and that the market risk premium is 5%. What is the required rate of return on the firm's stock?

d. Assume that Temp Force is a constant growth company whose last dividend (D0, which was paid yesterday) was $2.00 and whose dividend is expected to grow indefinitely at a 6% rate. (1) What is the firm's expected dividend stream over the next 3 years? (2) What is the firm's current intrinsic stock price? (3) What is the stock's expected value 1 year from now? (4) What are the expected dividend yield, the expected capital gains yield, and the expected total return during the first year?

In: Accounting

Pronouns are words that take the place of nouns, noun phrases, or other pronouns. Pronouns can...

Pronouns are words that take the place of nouns, noun phrases, or other pronouns. Pronouns can be the subject of a sentence, the object of a sentence, or in the possessive case. A pronoun should agree in number and gender with its antecedent. An antecedent is the word the pronoun stands for. The following is one rule for pronouns.

Rule: Use the singular pronoun with "everyone," "anyone," and "each."

Incorrect: Each player on the girls’ soccer team wants their coach to play them in the championship game.

Correct: Each player on the girls’ soccer team wants her coach to play her in the championship game.

Directions: Click on the blank lines that follow and select the pronoun that agrees with its antecedent.

The Soaring Sullivans

Professional Acrobats' Club

Fan Trivia

1. The club got its/their name from founding member Robert Sullivan.

2. After club practices, each of the acrobats soaks their/his or her muscles in a custom-made hot tub.

3. Nearly everybody in the club has broken his/its wrist at least once. Despite the dangers, club president Jim Chevalier says he considers him/himself a careful person.

4. Mr. Chevalier's wife is the booking agent for the club. She/Her and Jim take care of business issues such as recruiting and finance.

5. Mr. Kirk Lyons, a member of the club, became a hero to a local girl after she/he shinnied up a utility pole and rescued her kitten. The girl's family arrived and thanked Mr. Lyons. The heroic acrobat then gave free show tickets to the girl and them/they . The girl told a reporter at the scene that although the president of the United States is her role model, Mr. Lyons is just as cool as him/he .

6. The local press became interested in all the members of the acrobats' club. Reporters interviewed every single one of them/him . Shortly after the article was published, dozens of people auditioned before Jim Chevalier, hoping he/him would offer them/they membership to the elite club.

In: Operations Management