Questions
What U. S. organizations use organizational open, natural and rational?

What U. S. organizations use organizational open, natural and rational?

In: Operations Management

Why was there such strong popular support for McCarthy's anticommunist crusade in the early 1950s? Would...

Why was there such strong popular support for McCarthy's anticommunist crusade in the early 1950s? Would you have supported his goals and tactics? Why or why not?

In: Psychology

NEED THE COMPLETE AND CLEAR SOLUTION thanks An isotonic solution will produce an osmotic pressure of...

NEED THE COMPLETE AND CLEAR SOLUTION thanks

An isotonic solution will produce an osmotic pressure of 7.84 atm measured against pure water at human body temperature (37.0 °C). How many g of sodium chloride must be dissolved in a liter of water to produce an isotonic solution?

In: Chemistry

9. The American novelist James Baldwin wrote, "Words like freedom, justice, democracy are not common concepts;...

9. The American novelist James Baldwin wrote, "Words like freedom, justice, democracy are not common concepts; on the contrary, they are rare. People are not born knowing what these are. It takes enormous and, above all, individual effort to arrive at the respect for other people that these words imply." Ask students to define the terms freedom, justice, and democracy. How did the students derive their own meaning for these words?

In: Psychology

Write a complete C++ program to implements a Min-heap. Each node will contain a single integer...

Write a complete C++ program to implements a Min-heap.

Each node will contain a single integer data element. Initialize the Min-heap to contain 5 nodes, with the values 8, 12, 24, 32, 42.

The program should allow for the insertion and deletion of nodes while maintaining a Min-Heap.

The program should allow the user to output data in Preorder, Inorder and Postorder.

The program should loop with menu items for each of the above objectives and the choice to quit

Here's the code:

**EDIT: Need help in outputting data into Preorder, Inorder and Postorder, plus ensuring the nodes are implemented correctly (I think I overlooked this part). **

#include studio.h
#include isotream

int array[100]; // variable for array to store up to 100 elements
int n;


using namespace std;
void display();
void delete_elem(int num);


void heapify(int index,int n){
if(index >= n)return;
  

int left = 2*index;
int right = 2*index + 1;
int mx_ind = index;
if(left < n and array[left] > array[mx_ind]){
mx_ind = left;
}
if(right < n and array[right] > array[mx_ind]){
mx_ind = right;
}
if(mx_ind != index){
swap(array[mx_ind],array[index]);
heapify(mx_ind,n);
}

}
int insert(int num, int location)
{
int parentnode;
while (location > 0)
{
parentnode =(location - 1)/2;
if (num <= array[parentnode])
{
array[location] = num;
return location;
}
array[location] = array[parentnode];
location = parentnode;
}
array[0] = num;
return 0;
}

int main()
{
int choice, num;
n = 0;
while(1)
{
printf("1.Insert the element \n");
printf("2.Delete the element \n");
printf("3.Display all elements \n");
printf("4.Quit \n");
printf("Enter your choice : ");
scanf("%d", &choice);
switch(choice)
{
case 1:
printf("Enter the element to be inserted to the list : ");
scanf("%d", &num);
insert(num, n);
n = n + 1;
break;
case 2:
printf("Enter the elements to be deleted from the list: ");
scanf("%d", &num);
delete_elem(num);
break;
case 3:
display();
break;
case 4:
exit(0);
default:
printf("Invalid choice \n");
}
}
}

void display()
{
int i;
if (n == 0)
{
printf("Heap is empty \n");
return;
}
for (i = 0; i < n; i++)
printf("%d ", array[i]);
printf("\n");
}


void delete_elem(int num)
{
int left, right, i, temp, parentnode;

for (i = 0; i < num; i++) {
if (num == array[i])
break;
}
if (num != array[i])
{
printf("%d not found in heap list\n", num);
return;
}
array[i] = array[n - 1];
n = n - 1;
parentnode =(i - 1) / 2;
if (array[i] > array[parentnode])
{
insert(array[i], i);
return;
}
left = 2 * i + 1;
right = 2 * i + 2;
while (right < n)
{
if (array[i] >= array[left] && array[i] >= array[right])
return;
if (array[right] <= array[left])
{
temp = array[i];
array[i] = array[left];
array[left] = temp;
i = left;
}
else
{
temp = array[i];
array[i] = array[right];
array[right] = temp;
i = right;
}
left = 2 * i + 1;
right = 2 * i + 2;
}
if (left == n - 1 && array[i])
{
temp = array[i];
array[i] = array[left];
array[left] = temp;
}
}

In: Computer Science

C++ For this assignment, you will implement the MyString class. Like the string class in C++’s...

C++

For this assignment, you will implement the MyString class. Like the string class in C++’s standard library, this class uses C-strings as the underlying data structure. Recall that a C-string is a null-terminated array of type char. See section 8.1 in Savitch for more information about C-strings; in particular, you will find it helpful to take advantage of several of the C-string functions mentioned in that section. What To Do. In the hw8 directory that is created, you will find the following files: • mystring.h and mystring.cpp • a Makefile • and 4 test files (test1.cpp through test4.cpp). (Below are the files mentioned here, with one sample file). Implement the following: 1. a default constructor 2. a constructor that takes a const char * parameter (that is, a C-string) 3. a destructor 4. a copy constructor 5. the assignment operator. In addition, overload the following relational operators: >, <, >=, <=, ==, and !=. Lastly, overload the operator+ (concatenation). All of the relational operators return type int. To understand why, read the description of the C-string function strcmp. All of the comparisons should be lexicographical, i.e., similar to what strcmp() does. The == and != operators should evaluate to 1 if the condition is true, 0 if false. You are welcome to implement some of the operators by using others (for example, you can easily implement != using ==). Make sure that you can invoke the operators with string literals on either side of the operator. That is, both of the following expressions should be valid: str == "hello" "hello" == str where str is a MyString object. Place the member function implementations in mystring.cpp and compile using make. You can also edit mystring.h if you wish to implement some of the member functions directly in the class definition

Make File:

CC = g++
CXX = g++

INCLUDES =

CFLAGS = -Wall $(INCLUDES)
CXXFLAGS = -Wall $(INCLUDES)

LDFLAGS =
LDLIBS =

executables = test1 test2 test3 test4
objects = mystring.o test1.o test2.o test3.o test4.o

.PHONY: default
default: $(executables)

$(executables): mystring.o

$(objects): mystring.h


.PHONY: clean
clean:
   rm -f *~ a.out core $(objects) $(executables)

.PHONY: all
all: clean default

mystring.cpp:

#include

#include

#include "mystring.h"

// Insertion (put-to) operator

std::ostream& operator<<(std::ostream& outs, const MyString& s)

{

outs << s.data;

return outs;

}

// Extraction (get-from) operator

std::istream& operator>>(std::istream& is, MyString& s)

{

// Though this cheats a bit, it's meant to illustrate how this

// function can work.

  

std::string temp;

is >> temp;

delete[] s.data;

s.len = strlen(temp.c_str());

s.data = new char[s.len+1];

strcpy(s.data, temp.c_str());

return is;

}

mystring.h:

#ifndef _MYSTRING_H_

#define _MYSTRING_H_

#include

class MyString {

public:

// default constructor

MyString();

// constructor

MyString(const char* p);

// destructor

~MyString();

// copy constructor

MyString(const MyString& s);

// assignment operator

MyString& operator=(const MyString& s);

// returns the length of the string

int length() const { return len; }

// insertion (or put-to) operator

friend std::ostream& operator<<(std::ostream& outs, const MyString& s);

// extraction (or get-from) operator

friend std::istream& operator>>(std::istream& is, MyString& s);

// concatenates two strings

friend MyString operator+(const MyString& s1, const MyString& s2);

// relational operators

friend int operator<(const MyString& s1, const MyString& s2);

friend int operator>(const MyString& s1, const MyString& s2);

friend int operator==(const MyString& s1, const MyString& s2);

friend int operator!=(const MyString& s1, const MyString& s2);

friend int operator<=(const MyString& s1, const MyString& s2);

friend int operator>=(const MyString& s1, const MyString& s2);

private:

char* data;

int len;

};

#endif

Here is a sample test file:

#include "mystring.h"

static MyString add(MyString s1, MyString s2)

{

MyString temp(" and ");

return s1 + temp + s2;

}

int main()

{

using namespace std;

MyString s1("one");

MyString s2("two");

MyString s3 = add(s1, s2);

cout << s3 << endl;

return 0;

}

In: Computer Science

Explain two factors that may affect the IT project cost estimation using your own words. Support...

Explain two factors that may affect the IT project cost estimation using your own words. Support your answer with examples.

In: Computer Science

True/False: The advantage to being the late mover or follower strategy is that you learn from...

True/False: The advantage to being the late mover or follower strategy is that you learn from the mistakes that the first mover makes.

True/False: Firms have to choose between two different strategies of entry one is a non-equity strategy and the other is an equity strategy.

True/False:Joint ventures are considered a desirable strategy for firms that want tight control over the foreign operations.

Please also give a reasoning if you can, thanks!

In: Operations Management

The Neal Company wants to estimate next year's return on equity (ROE) under different financial leverage...

The Neal Company wants to estimate next year's return on equity (ROE) under different financial leverage ratios. Neal's total capital is $14 million, it currently uses only common equity, it has no future plans to use preferred stock in its capital structure, and its federal-plus-state tax rate is 40%. The CFO has estimated next year's EBIT for three possible states of the world: $5.8 million with a 0.2 probability, $3.4 million with a 0.5 probability, and $0.6 million with a 0.3 probability. Calculate Neal's expected ROE, standard deviation, and coefficient of variation for each of the following debt-to-capital ratios. Do not round intermediate calculations. Round your answers to two decimal places at the end of the calculations.

Debt/Capital ratio is 0.

RÔE = %
σ = %
CV =

Debt/Capital ratio is 10%, interest rate is 9%.

RÔE = %
σ = %
CV =

Debt/Capital ratio is 50%, interest rate is 11%.

RÔE = %
σ = %
CV =

Debt/Capital ratio is 60%, interest rate is 14%.

RÔE = %
σ = %
CV =

In: Finance

A set of X-Y data pairs are X Y -0.14 0.69 1.91 -0.25 2.33 2.29 3.68...

A set of X-Y data pairs are

X Y
-0.14 0.69
1.91 -0.25
2.33 2.29
3.68 3.72
3.51 3.23
4.09 4.76
6.27 7.88
6.32 8.59
7.42 8.73
8.72 8.45
10.35 10.67
10.09 11.29

Compute the intercept β0 regression coefficient for this data.

In: Math

Why should a Code of Ethics be established and supported by senior leadership in a healthcare...

Why should a Code of Ethics be established and supported by senior leadership in a healthcare facility? 250 words please.

In: Nursing

Please Use your keyboard (Don't use handwriting) MGT211 I need new and unique answers, please. (Use...

Please Use your keyboard (Don't use handwriting)

MGT211

I need new and unique answers, please. (Use your own words, don't copy and paste)

THE RELUCTANT WORKERS

Tim Aston had changed employers three months ago. His new position was project manager.

At first he had stars in his eyes about becoming the best project manager that his company had ever seen. Now, he wasn’t sure if project management was worth the effort. He made an appointment to see Phil Davies, director of project management.

Tim Aston: “Phil, I’m a little unhappy about the way things are going. I just can’t seem to motivate my people. Every day, at 4:30 P.M., all of my people clean off their desks and go home. I’ve had people walk out of late afternoon team meetings because they were afraid that they’d miss their car pool. I have to schedule morning team meetings.”

Phil Davies: “Look, Tim. You’re going to have to realize that in a project environment, people think that they come first and that the project is second. This is a way of life in our organizational form.”

Tim Aston: “I’ve continually asked my people to come to me if they have problems. I find that the people do not think that they need help and, therefore, do not want it. I just can’t get my people to communicate more.”

Phil Davies: “The average age of our employees is about forty-six. Most of our people have been here for twenty years. They’re set in their ways. You’re the first person that we’ve hired in the past three years. Some of our people may just resent seeing a thirty-year-old project manager.”

Tim Aston: “I found one guy in the accounting department who has an excellent head on his shoulders. He’s very interested in project management. I asked his boss if he’d release him for a position in project management, and his boss just laughed at me, saying something to the effect that as long as that guy is doing a good job for him, he’ll never be released for an assignment elsewhere in the company. His boss seems more worried about his personal empire than he does in what’s best for the company.

“We had a test scheduled for last week. The customer’s top management was planning on flying in for firsthand observations. Two of my people said that they had programmed vacation days coming, and that they would not change, under any conditions. One guy was going fishing and the other guy was planning to spend a few days working with fatherless children in our community. Surely, these guys could change their plans for the test.”

Phil Davies: “Many of our people have social responsibilities and outside interests. We encourage social responsibilities and only hope that the outside interests do not interfere with their jobs.

“There’s one thing you should understand about our people. With an average age of fortysix, many of our people are at the top of their pay grades and have no place to go. They must look elsewhere for interests. These are the people you have to work with and motivate. Perhaps you should do some reading on human behavior.

  1. “Employees are not showing interest in meetings and discussion”. Why do you think such culture exists in the company? Share your views.
  2. What are the challenges Tim is facing to execute his project. Explain.
  3. “Motivation is a key to change”- what according to you should be Tim’s approach towards employees.
  4. What is Work, Life balance? What role does it play in day-to-day life of an employee?

In: Operations Management

PLEASE I HAVE TO RETURN IN 20 MINUTES, I HAVE ALREADY DO THE QUESTION 1, 2,...

PLEASE I HAVE TO RETURN IN 20 MINUTES, I HAVE ALREADY DO THE QUESTION 1, 2, 3, 4 BUT THE QUESTION 5 I CAN'T

In python :

1)Write a sum function expecting an array of integers and returning its sum.

2) Write a multiply function excepting two arrays of integers and returning the product array term by term.

For example mutliply([1,2,3], [5,4,3]) will give [5,8,9]

3) Write a nb1 function expecting an array containing only 0 and 1 and returning the number of 1 present in the array.

4)Write a conFilter function expecting an integer n and creating an array of size n randomly filled with 0 and 1.

5) With these functions offer a random solution to the backpack problem. Here are some indications:

- The consFilter function allows you to construct an array retaining only one part of the objects to place in your backpack. So if the list of objects is [1,4,6,1] and the filter is [1,0,1,0], then by doing the product of the two you will get [1,0,6,0].

- You can generate a large number of random filters, for each of these filters to test if the objects thus filtered fit in the backpack. The rest comes down to a maximum calculation.

- You must make the best list of the weights of the objects fitting in the backpack. For example, if your backpack can hold 20kg, the list of items is [10, 1, 5, 8, 3, 9], one of the ways to optimize your bag is to put [10, 1, 3, 5] or 19kg.

Test on tables of 10-15 objects between 1 and 100kg each for a bag weight of 200 to 300kg.

In: Computer Science

You own a small networking startup. You have just received an offer to buy your firm...

You own a small networking startup. You have just received an offer to buy your firm from a​ large, publicly traded​ firm, JCH Systems. Under the terms of the​ offer, you will receive 1 million shares of JCH. JCH stock currently trades for $25.63 per share. You can sell the shares of JCH that you will receive in the market at any time. But as part of the​ offer, JCH also agrees that at the end of one​ year, it will buy the shares back from you for $25.63 per share if you desire. Suppose the current​ one-year risk-free rate is 5.95%​, the volatility of JCH stock is 29.4%​, and JCH does not pay dividends.​ Round all intermediate values to five decimal places as needed.

a. Is this offer worth more than $25.63 million? Explain.

b. What is the value of the​ offer?

In: Finance

Critique the stage model by identifying at least two strengths and potential weaknesses of using this...

Critique the stage model by identifying at least two strengths and potential weaknesses of using this framework for understanding family process.

In: Psychology