Questions
I am trying to write a python code to create a function that returns all possible...

I am trying to write a python code to create a function that returns all possible dimensions (reshaping) for an input matrix, can someone explains the math and write a python code with explaining all the steps and give me a test cases, and please explain if there is more than one approach. so if we have 1*8 matrix we should return 1*8, 2*4,4*2,8*1

def reshaping(M) should return a n ORDERED list AND the all possible reshaped matrices

In: Computer Science

Define the word “ethics” as you see it. Give us an example of how that definition...

Define the word “ethics” as you see it. Give us an example of how that definition would play out in your daily life as a professional in the arena of public health.

What are some consequences that might occur if the organization’s ethics were either ignored or compromised? As a leader/manager in the organization how would you handle it?

In: Psychology

1. Discuss the use of the C.B.R. value in the design of pavement. 2. Discuss some...

1. Discuss the use of the C.B.R. value in the design of pavement.

2. Discuss some of the defects you will encounter in maintenance of roads.

3. What is the use of a grader and a scraper in the construction of road?

4. Briefly explain the Marshall test. Discuss the use of the test.

5. Outline three methods by which the viscosity of bitumen can be reduced to facilitate its application.

6. Discuss the functions of a primer in bituminous surfacing.

8. A drainage system is an important part of any road. Discuss its functions.

9. Explain the concept of “equivalent standard axle”.

10. List the pre-construction activities which will be necessary for a new road deviation in a rural area.

In: Civil Engineering

Medium Size Mart, Inc. is considering a project with the following cash flows: Initial cash outlay...

Medium Size Mart, Inc. is considering a project with the following cash flows:

Initial cash outlay = $2,100,000

After–tax net operating cash flows for years 1 to 3 = $775,000 per year

Additional after–tax terminal cash flow at the end of year 3 = $600,000

Compute the profitability index of this project if Medium Mart’s WACC is 10%. Enter your answer rounded to two decimal places. For example, if your answer is 123.45% or 1.2345 then enter as 1.23 in the answer box.

In: Finance

Analyze the demographic and economic data of a country that Walmart is currently not operating in....

  • Analyze the demographic and economic data of a country that Walmart is currently not operating in.
  • Conduct an analysis for Walmart leadership about the country’s culture based upon the GLOBE’s nine dimensions of culture.
  • Explain how Walmart’s leadership skills and practices may lead to organizational success.
  • Formulate a model of cultural and ethical leadership as it applies to Walmart at a global level.

In: Operations Management

U.S. Treasury 30 year maturity, zero coupon bonds are currently selling in the marketplace with a...

U.S. Treasury 30 year maturity, zero coupon bonds are currently selling in the marketplace with a yield to maturity of 7.00%. Even though the bonds have a coupon rate of 0.00%, please assume semi–annual compounding, which is the bond market convention? If inflation increased unexpectedly, forcing the nominal required rate of return on these Treasury bonds to increase by 1.75% to 8.75%, by what dollar amount would the current market price of these bonds decrease?  

In: Finance

Treynor Pie Company is a food company specializing in high-calorie snack foods. It is seeking to...

Treynor Pie Company is a food company specializing in high-calorie snack foods. It is seeking to diversify its food business and lower its risks. It is examining three companies—a gourmet restaurant chain, a baby food company, and a nutritional products firm. Each of these companies can be bought at the same multiple of earnings. The following represents information about all the companies.
  

Company Correlation with
Treynor Pie
Company
Sales
($ millions)
Expected Earnings
($ millions)
Standard Deviation
in Earnings
($ millions)
Treynor Pie Company + 1.0 $ 148 $ 10 $ 4.0
Gourmet restaurant + 0.5 66 6 1.2
Baby food company + 0.4 52 4 1.9
Nutritional products company 0.7 74 5 3.1


a-1. Compute the coefficient of variation for each of the four companies. (Enter your answers in millions (e.g., $100,000 should be entered as ".10"). Round your answers to 3 decimal places.)
  

Coefficient of Variation
Treynor Pie Company
Gourmet restaurant
Baby food company
Nutritional products company

a-2. Which company is the least risky?
  

  • Nutritional products company

  • Treynor Pie Company

  • Baby food company

  • Gourmet restaurant

a-3. Which company is the most risky?
  

  • Baby food company

  • Nutritional products company

  • Treynor Pie Company

  • Gourmet restaurant

b. Which of the acquisition candidates is most likely to reduce Treynor Pie Company's risk?
  

  • Gourmet restaurant

  • Nutritional products company

  • Baby food company

In: Finance

#include <iostream> using namespace std; string* callMe(string*& s){ static string* str = new string{"Chiqita Banana"}; str...

#include <iostream>

using namespace std;


string* callMe(string*& s){
static string* str = new string{"Chiqita Banana"};
str = s;
return str;
}

int main()
{
string* s = new string{"Hey Google"};
string* str = callMe(s);
  
cout << "Call me \'" + *str +"\'";
return 0;
}

1. What is the output or the error of this program?

Call me 'Hey Google'

2. And please explain the data flow in detail (to memory level)?

Please help question 2 with explanation, thank you!

In: Computer Science

Outline the factors contributing to the successful development and performance of a team. (question is related...

Outline the factors contributing to the successful development and performance of a team. (question is related to team managment)

In: Operations Management

You are given two classes for implementing a simple binary tree of capable of storing number,...

You are given two classes for implementing a simple binary tree of capable of storing number, count the number of leaves and computes the height of a binary tree.

You can add on additional parameters or functions as you wish, but the program must apply the chapter objectives.

class BTreeNode { //node for the binary tree items

  public:

    BTreeNode(double x, BTreeNode *leftp = NULL, BTreNode *rightp = NULL) {

      value = x;

      left = leftp;

      right = rightp;

    }

  private:

    double value;

    BTreeNode *left, *right;

    friend class BST; //BST has friend status

};

class BST { //binary tree class

  public:

    int height() { //returns the tree height

      return height(tree);

    }

    void insert(double x); //inserts numbers into the binary tree

    void inorder(vector<double> &v) { //appends all nodes in subtree

      inorder(v, tree);

    }

    int leafCounter() { //counts the number of leaves

      return leafCounter(tree);

    }

    BST() {

      tree = NULL;

    }

  private:

    void inorder(vector<double>&tlist, BTreeNode *t); //storing nodes in a subtree

    int leafCounter(BTreeNode *t); //counts the number of leaves

    static int height(BTreeNode *t); //calculates the height of the tree

    BTreeNode *tree;

}

In: Computer Science

What are the advantages of a taser over other use of force options? Does the public...

What are the advantages of a taser over other use of force options? Does the public have the right to expect “safe” measures when resisting arrest? What are legitimate expectations in this regard?

In: Psychology

how to know if a demand is "dynamic". please specify all the steps,

how to know if a demand is "dynamic". please specify all the steps,

In: Operations Management

Briefly describe human pseudoautosomal regions. Why did they evolve? How do they differ from other regions...

Briefly describe human pseudoautosomal regions. Why did they evolve? How do they differ from other regions of X and Y? Provide information you feel is relevant and key to their existence.

In: Biology

hello please correct this code print("The Miles Per Gallon program") print() Trips = [] trip =...

hello please correct this code

print("The Miles Per Gallon program")
print()
Trips = []
trip = 0
while 1:
    print("Do you want to add a trip from a csv file or Enter it manually? 1 for csv 2 for entering it manually")
    method = int(input())
    if method == 1:
        print("Enter the filename")
        fileName = input()
        try:
            with open(fileName, 'r') as myFile1:
                reader = csv.reader(myFile1)
                Trips = list(reader)
            print("Miles Driven  Gallons Used \tMPG")
            for i in Trips:
                for j in i:
                    print(j, end=" ")
                print()

        except IOError:
            print ("Could not read file:", fileName)
            
    elif method == 2:
        while 1:
            miles_driven = input("Enter miles driven: ")
            try:
                val = int(miles_driven)
                break
            except ValueError:
                print("No.. input string is not an Integer. It's a string")
        while 1:
            gallons_used = input("Enter gallons of gas used: ")
            try:
                val2 = int(gallons_used)
                break
            except ValueError:
                print("No.. input string is not an Integer. It's a string")
        mpg = val / val2
        mpg = round(mpg, 2)
        Trips.append([])
        Trips[trip].append(miles_driven)
        Trips[trip].append(gallons_used)
        Trips[trip].append(mpg)
        print("Miles Driven  Gallons Used \tMPG")
        for i in Trips:
            for j in i:
                print(j, end= " ")
            print()
        trip += 1
    choice = int(input("Do you want to add another trip? 1 for yes 0 for no "))
    if choice == 1:
        continue
    elif choice == 0:
        break

myFile = open('trips.csv', 'w')
with myFile:
   writer = csv.writer(myFile)
   writer.writerows(Trips)

with open('trips.csv', newline='') as myFile:
    reader = csv.reader(myFile)
    for row in reader:
        print(row)
    print("Elemnts from the csv file printed which means it was stored successfully")

i need result as

EXAMPLE RUN 1: - Bad filename C:\Files.py The Miles Per Gallon program

Would you like to read trips from a file? y/n: y Enter the csv filename containing trip data: test Trips not read from file - file not found: test Would you like to enter trip data? y/n: y Enter miles driven: 100 Enter gallons of gas used: 10 1. Miles: 100.0 Gallons of Gas: 10.0 Mpg: 10.0

Would you like to continue? y/n: y Enter miles driven: 50 Enter gallons of gas used: 5 1. Miles: 100.0 Gallons of Gas: 10.0 Mpg: 10.0 2. Miles: 50.0 Gallons of Gas: 5.0 Mpg: 10.0

Would you like to continue? y/n: n

EXAMPLE RUN 2: Good filename and good inputs

C:\y The Miles Per Gallon program

Would you like to read trips from a file? y/n: y Enter the csv filename containing trip data: trips.csv Trips: 1. Miles: 100.0 Gallons of Gas: 10.0 Mpg: 10.0 2. Miles: 50.0 Gallons of Gas: 5.0 Mpg: 10.0


Would you like to enter trip data? y/n: y Enter miles driven: 75 Enter gallons of gas used: 4 1. Miles: 100.0 Gallons of Gas: 10.0 Mpg: 10.0 2. Miles: 50.0 Gallons of Gas: 5.0 Mpg: 10.0 3. Miles: 75.0 Gallons of Gas: 4.0 Mpg: 18.75

Would you like to continue? y/n: n
c:\\
EXAMPLE RUN 3: Good Filename – bad user inputs

The Miles Per Gallon program

Would you like to read trips from a file? y/n: y Enter the csv filename containing trip data: trips.csv Trips: 1. Miles: 100.0 Gallons of Gas: 10.0 Mpg: 10.0 2. Miles: 50.0 Gallons of Gas: 5.0 Mpg: 10.0 3. Miles: 75.0 Gallons of Gas: 4.0 Mpg: 18.75

In: Computer Science

Define the items below and explain how the strategy functions towards effective customer relationship management (CRM)....

Define the items below and explain how the strategy functions towards effective

customer relationship management (CRM).

a. Loyalty programs

b. Premium and Gifts

c. Social media.

In: Psychology