Questions
I am trying to create a basic shell program in C that runs 10 commands and...

I am trying to create a basic shell program in C that runs 10 commands and then quits. Only one word commands are required, like:

cal, date, ls, ps, pwd, who, quit

The part I am struggling with is passing the scanned command into my array in the child process to be executed using execvp().

Here is my code:

#include <stdio.h>
#include <string.h>
#include<stdlib.h>
#include<unistd.h>
#include<sys/types.h>
#include<sys/wait.h>
#include<readline/readline.h>
#include<readline/history.h>

#define MAX_CMD_NUMBER 10

int main()
{
   int i;
   char command[10];

   for (i=0; i< 10; i++)
    {
      printf("COMMAND-> ");
      fflush(stdout);
      scanf("%s", command); // takes in the user's single-string command
      if (strcmp(command, "quit") == 0)
         i = MAX_CMD_NUMBER; // terminate the loop
      else
         printf("Command #%d is: %s\n", i, command);
     }

printf("hello world (pid:%d)\n", (int) getpid());
int rc = fork();
    if (rc < 0) {
        // fork failed; exit
        fprintf(stderr, "fork failed\n");
        exit(1);
    }
    else if (rc == 0)
    {
        char *command[2];
        command[0] = strdup(command);
        command[1] = NULL;        
        execvp(command[0], command);
        printf("this shouldn't print out");
    }
      else
      {
        command = wait(NULL);
    }
    return 0;
}

In: Computer Science

Please paraphrase this paragraph into a short summary.. Good philosophical thinking takes time. Progress in good...

Please paraphrase this paragraph into a short summary..

Good philosophical thinking takes time. Progress in good critical thinking is often very slow. The process of critical thinking can’t be called successful if it efficiently maximizes its inputs and outputs in the shortest measure of time: We do not produce thoughts in the mind like widgets in a factory. The reason for this is because good critical think- ing often needs to uncover that which subtle, hard to discern at first, and easy to overlook. I define subtlety as ‘a small difference or a delicate detail which takes on greater importance the more it is contemplated.’ As a demonstration, think of how many ways you can utter the word ‘Yes’, and mean something different every time. This also underlines the importance of precision, as a good thinking habit. As another example: Think of how the colour planes in a painting by Piet Mondrian, such as his ‘Composition with Yellow, Blue, and Red’ have squares of white framed by black lines, but none of the white squares are exactly the same shade of white. You won’t notice this if you look at the painting for only a few seconds, or if you view a photo of the painting on your computer screen, and your monitor’s resolution isn’t precise enough to render the subtle differences. But it is the job of reason to uncover those subtleties and lay them out to be examined directly. And the search for those subtleties cannot be rushed.

In: Psychology

Pam Alvarez and Shawna Jones are senior vice-presidents of Mutual of Whitewater. They are co-directors of...

Pam Alvarez and Shawna Jones are senior vice-presidents of Mutual of Whitewater. They are co-directors of the company’s pension fund management division, with Alvarez having responsibility for fixed income securities (primarily bonds) and Jones being responsible for equity investments. A major new client, the Southwestern Municipal Alliance, has request that Mutual of Whitewater present an investment seminar to the mayors of the represented cities, and Alvarez and Jones, who will make the actual presentation, have asked you to help them.

          To illustrate the common stock valuation process, Alvarez and Jones have asked you to analyze the Temp Que Company, an employment agency that supplies word processor operators and computer programmers to businesses with temporarily heavy workloads. Stocks of companies with similar risk as Temp Que are currently yielding 13%. You are to answer the following questions (Show calculations clearly).

1) Suppose Temp Que is expected to experience zero growth during the first 3 years and then to resume its steady-state growth of 6 percent in the fourth year. What is the stock’s value now?

2) Why do stock prices change? Answer the question by using the following example: Suppose the expected D1 is $2, the growth rate is 5 percent, and R is 10 percent. Using the constant growth model, what is the price? What is the impact on stock price if g is 4 percent or 6 percent? If R is 9 percent or 11 percent?

In: Finance

The purpose of this assignment is to analyze data and use it to provide stakeholders with...

The purpose of this assignment is to analyze data and use it to provide stakeholders with potential answers to a previously identified business problem.

For this assignment, continue to assume the role of a data analyst at Adventure Works Cycling Company. Evaluate the data associated with the drop in sales for the popular model "LL Road Frame-Black 60." Provide a hypothesis on what could be contributing to the falling sales identified in the initial business problem presented by your manager.

In 250-500 words, share these recommendations in a Word document that addresses the following.

  1. Summary of the business problem including the requestor who initially brought the problem to you.
  2. Summary of the data that were requested and how they was obtained.
  3. Discussion of the limitations of the available data and ethical concerns related to those limitations.
  4. Hypothesis of why sales of the popular model have dropped based upon data analysis. Reference the Excel file that summarizes the data findings that resulted from your queries.
  5. Recommendations for addressing the business problem.
  6. In addition to the report, the manager has requested that you submit the Excel files summarizing the data findings that resulted from your queries.
  7. The manager has also requested that you update the ERD you created in the Topic 5 assignment to include the tables generated as a result of the joins completed in the Topic 6 assignment. The ERD should clearly document the work stream and relationships.

In: Computer Science

Porsche is expected to sell approximately 60,000 cars in the U.S. in 2019. I'll let you...

Porsche is expected to sell approximately 60,000 cars in the U.S. in 2019. I'll let you estimate an average selling price across Porsche models. For this example, let's assume that all the sales happen in December of 2019. Also, assume that Porsche has fully hedges their U.S. dollar exposure (based on predicted sales) using futures or forward contracts at a rate of $1.10 per Euro. What happens in the following situations:

a. the Dollar/Euro exchange rate remains unchanged and sales are as predicted

b. the Euro rises against the Dollar and the exchange rate moves to $1.00 per Euro. Sales are as predicted.

c. the Euro falls against the Dollar and the exchange rate moves to $1.25 per Euro. Sales are as predicted.

d. the Euro rises against the Dollar and the exchange rate moves to $1.00 per Euro. Sales are 20% higher than expected.

e. the Euro rises against the Dollar and the exchange rate moves to $1.00 per Euro. Sales are 20% lower than expected.

Be specific in your answers. Where does Porsche lose money, and how much? Where does Porsche make money and how much? What is the overall effect on Porsche's income in their home currency? FYI, you can make the Euro currency symbol in Word by using CRTL + ALT + E.  

In: Finance

Scenario: Your organization has used a variety of collaboration systems developed by some project managers. Some...

Scenario: Your organization has used a variety of collaboration systems developed by some project managers. Some of these systems were successful while others were not. Your organization has one unique challenge—many of your employees are staffed at other locations or work from home (telework). You would like to standardize the collaboration process to improve team communication for all company projects. In your presentation, you should include the elements listed below.

Explain why collaboration information systems (IS) are important from the organization’s perspective.

Discuss how collaboration tools can improve team communication.

Identify three tools that will be used for synchronous communications and three tools that will be used for asynchronous communications. Be sure to explain why you made these choices.

Describe how project files, such as Microsoft (MS) Word, MS Excel, MS Project, and MS Visio, will be shared with team members. Be sure to explain the rationale behind your choice.

Explain how the task list for managing tasks will be shared with team members. Be sure to explain the rationale behind your choice.

Discuss how this new collaboration IS could provide competitive advantages for your organization.

Your presentation should be a minimum of six slides in length (not counting the title and reference slides). Use of images, graphics, and diagrams is encouraged. You can use an industry of your choosing or examples from your personal or professional experiences in developing this assignment.

In: Operations Management

Marketing at Pepe’s Pizzeria focuses on the development, growth, and maintenance of cost-effective, high-value relationships with...

Marketing at Pepe’s Pizzeria focuses on the development, growth, and maintenance of cost-effective, high-value relationships with each of its customers. This type of marketing is known as _____.

a. direct marketing b. relationship marketing c. transaction-based marketing d. value-based marketing

The relationship between Pepe’s Pizzeria and its customers functions at which level of the relationship marketing continuum?

a. Fourth Level b. Third Level c. Second Level d. First Level

Pepe’s Pizzeria indulges in social interaction and interactive marketing with its customers on Twitter and Facebook. Thus, Pepe’s Pizzeria builds buyer–seller relationships through _____.

a. grassroots marketing b. database marketing c. frequency marketing d. interactive television

If Pepe’s Pizzeria built its brand equity by letting satisfied customers get the word out about its pizzas to other consumers, the type of marketing initiative used is known as _____.

a. affinity marketing b. ambush marketing c. viral marketing d. direct marketing

How can Pepe’s Pizzeria determine the costs it incurs to serve each customer and thus develop ways to increase its profitability?

a. By calculating the customer churn b. Through the payback method c. Through tracking rebates, coupons, and credit card purchases d. By calculating the lifetime value of its customers

In: Accounting

After analysing the financial data of Q-Constructions, you notice that they are trending in the right...

After analysing the financial data of Q-Constructions, you notice that they are trending in the right direction. A new 12-month construction proposal has come to the company worth $1,000,000 and an important question is whether it will be financially viable. They want you to analyse the proposal, in particular, the recommended cash flow schedule and to understand the key financial points during the construction project. The following cash flow schedule is summarised below.

To ensure that all upfront and on-going outlay costs are covered in advance, Q-Constructionsincur an initial start-up cost of $200,000. The proposal states that they will receive a deposit from the client of 10% of the total project cost at the beginning. They then receive four equal instalment payments of 20% of the total project cost associated to project milestones from the client at the end of the 2nd, 6th, 8thand 10thmonth. Finally, they receive the last 10% project milestone on lock-up which occurs at the end of the 12thmonth. Q-Constructionshas ongoing project costs of $20,000 to pay salaries and services at the end of each month. In additional, there are material costs of $100,000 associated for each of the project milestones at the end of the 2nd, 6th, 8thand 10thmonth. The current cost of capital for company is 8% per annum compounded monthly. You have been tasked with the important objective to determine whether this future project is financially viable. In addition, they want you to determine which milestone is needed to be completed in the project proposal such that it will be financially viable.  It’s time to show your Quants knowledge andexpertise with Excel to determine the financial viability of this project.

  1. In a worst-case scenario where the project does not proceed, and the initial outlay is paid. Calculate the amount of interest that would have accrued on an amount of $200,000 at the end of 12 months with an interest rate of 8% p.a compounded monthly. Do not use EXCEL for this calculation.

b. Set up a cash inflow and outflow for the 12-month construction project proposal based on the information provided by the company above. By using the current 8% p.a compounded monthly cost of capital, calculate the Net Present Value of this proposal and whether it is financially viable project. Use EXCEL to calculate the net present value of the current situation.

- The full spreadsheet with all completed entries.  Show how you entered cash inflow and cash outflow amounts at the beginning, 1st, 2nd, 3rdmonths.  You can type this in Word.

  1. The NPV calculation (showing the calculation via the Excel function NPV and Excel cell references is OK).  You can show this either in the spreadsheet or type it in Word.    

EXCEL Instructions:  Set up your spreadsheet as below and add yourinitials to column names (i.e. unless your initials really are NFY!).  The coloured boxes below contain instructions.  We used the NPV function in Lectures (Week 2) – see lecture recordings for a demonstration.

  1. The company wants to know at which milestone in the project proposal would be financially viable if the contract has terminated was early. Determine the milestone in the construction proposal for which the project would be financially viable.

d. Q-Constructionswould like you to create a visualisation of the completed NPV spreadsheet from part (b).  Include the graph here.

In: Accounting

This assignment concerns the idea of "private equity," a notion that is very important to the...

This assignment concerns the idea of "private equity," a notion that is very important to the financial strategy of firms. We had a brief discussion on Blackrock, which is a private equity firm. Many companies have recently been bought by private equity, including Dell. Private equity firms argue that they can re-engineer the firm without shareholders breathing down their neck.

But private equity can be a very dangerous thing. Private operators buy companies by borrowing money, then load the debt on the companies books, strip it of all value, and leave it to go bankrupt. A particularly egregious case involved the Simmons mattress company, and the same might be unfolding at Toys R Us.

In his 2014 letter to investors, Warren Buffet had warned about the ethics of this phenomenon:

Families that own successful businesses have multiple options when they contemplate sale. Frequently, the best decision is to do nothing. There are worse things in life than having a prosperous business that one understands well. But sitting tight is seldom recommended by Wall Street. (Don’t ask the barber whether you need a haircut.)

When one part of a family wishes to sell while others wish to continue, a public offering often makes sense. But, when owners wish to cash out entirely, they usually consider one of two paths.

The first is sale to a competitor who is salivating at the possibility of wringing “synergies” from the combining of the two companies. This buyer invariably contemplates getting rid of large numbers of the seller’s associates, the very people who have helped the owner build his business. A caring owner, however – and there are plenty of them – usually does not want to leave his long-time associates sadly singing the old country song: “She got the goldmine, I got the shaft.”

The second choice for sellers is the Wall Street buyer. For some years, these purchasers accurately called themselves “leveraged buyout firms.” When that term got a bad name in the early 1990s – remember RJR and Barbarians at the Gate? – these buyers hastily relabeled themselves “private-equity.”

The name may have changed but that was all: Equity is dramatically reduced and debt is piled on in virtually all private-equity purchases. Indeed, the amount that a private-equity purchaser offers to the seller is in part determined by the buyer assessing the maximum amount of debt that can be placed on the acquired company.

Later, if things go well and equity begins to build, leveraged buy-out shops will often seek to re-leverage with new borrowings. They then typically use part of the proceeds to pay a huge dividend that drives equity sharply downward, sometimes even to a negative figure.

In truth, “equity” is a dirty word for many private-equity buyers; what they love is debt. And, because debt is currently so inexpensive, these buyers can frequently pay top dollar. Later, the business will be resold, often to another leveraged buyer. In effect, the business becomes a piece of merchandise.

So workers and customers suffer, while financiers make money.

In this assignment, please write a 500-word analysis of private equity. Give your essay an original title. You can be pro-private equity or anti. I want you demonstrate how well you understand this concept.

In: Finance

Written Assignment 2 – Drafting a Legal Contract Instructions: You are a garment manufacturer and retailer...

Written Assignment 2 – Drafting a Legal Contract Instructions:

You are a garment manufacturer and retailer in Los Angeles named “[YOUR LAST NAME]’s Academy Award Clothes” who manufactures, distributes and sells suits and other clothing from a factory/warehouse/showroom building at 711 S Hope St, Los Angeles, CA 90017. Prepare a contract for the purchase and sale of [choose and insert your favorite, most striking or outlandish color/pattern/texture combination] custom sport coats to one of your company’s biggest customers, “Century 22 Real Estate”. The customer wants to custom order and utilize these distinctive colored/textured jackets for all of their sales people to wear as walking business cards. Apply your knowledge of business, law and contracts to draft this contract. Use and insert your last name to create your company name. Determine which type of business entities the parties are (see Ch 16, pp 498-499 Business Entities chart). Be sure to insert the business entity form in the name of each party. Be sure to include ALL the relevant necessary contract provisions drafting the contract. The contract must include EACH of the following, as set forth, and IN THE NUMBERED ORDER and DETAILED, as follows: I. Introduction: In the introductory paragraph set forth the names of the parties to the written contract - buyer(s) and seller(s), and FOR EACH PARTY MUST: State party’s complete name, including designation of the type of business entity (whether a business organization or an individual) Identify what type of business entity form (LLC, Corporation, Limited Partnership, Limited Liability Partnership, General Partnership Sole Proprietor, etc.) State the individual signor’s name of that person signing on behalf of the business State the signer's official title for the company (Managing Partner, Managing Member, President, CEO, Sole-Owner, etc.) II. The specific terms of the sale including EXACTLY the following contract clause provisions NUMBERED EXACTLY IN ORDER as follows: Sale of Goods and Purchase Price. (including: description of the products, quantity, individual unit prices and total price) Invoices, Payments (incl. late fees) Delivery, Risk of Loss, Title Acceptance Notices Warranty Warranty of Title Indemnification Liquidated Damages Taxes Security Interest Time is of the Essence Severability (of individual provisions) Force Majeure (Act of God) Assignment; Delegation Arbitration and/or Mediation Provision Cancellation Governing Law and Forum Selection Service of Suit Attorney Fee Provision Severability Entire Agreement (Integration Clause statement that contract constitutes entire agreement) Counterparts III. Signatures blocks of authorized signatories with: names and official titles typed in; a line for authorized signors to sign their signature; and a line for the signing date Format: Your assignment should be typewritten with your name and class section number at the top. Upload as a PDF or WORD file. Use the SAMPLES of contracts and clause provisions (Word document) attached with this assignment, or you may perform internet searches to find the correct clauses to compose the contract.

In: Economics