Questions
in C++ Given two integer arrays sorted in the ascending order, code the function SortArrays to...

in C++

Given two integer arrays sorted in the ascending order, code the function SortArrays to merge them into one array in the descending order. You need to make sure if the values in the arrays are changed, it will still work. (25 points)

#include <iostream>

using namespace std;

void SortArrays (int a[], int b[], int c[], int size);

void printArray(int m[], int length);

const int NUM = 5;

int main()

{

int arrA[NUM] = {-2, 31, 43, 55, 67};

int arrB[NUM] = {-4, 9, 11, 17, 19};

int result[2*NUM];

SortArrays(arrA, arrB, result, NUM);

printArray(result, 2*NUM);

return 0;

}

void SortArrays (int a[], int b[], int c[], int size)

{

}

void printArray(int m[], int length)

{

for(int i = 0; i < length; i++)

cout<< m[i]<<" ";

cout<<endl;

}

In: Computer Science

Ethics emphasizes happiness, justice, human rights, and equality. How do these ideas relate to the environment...

Ethics emphasizes happiness, justice, human rights, and equality. How do these ideas relate to the environment and future generations? Support your perspective using ethical theorie(s).

In: Operations Management

How might our attribution about the cause of a behavior be different for ourselves versus someone...

How might our attribution about the cause of a behavior be different for ourselves versus someone else? Please be sure to base your answer on social psychological theory, including concepts from the Self, Social Cognition, and Social Perception chapters. (3 points)

Why is it important to take into account both situational and dispositional factors when attempting to describe, predict, or explain behavior? In other words, how does your attribution of the cause of a behavior influence how you respond to that behavior? Please also be sure to include possible negative consequences of failing to consider dispositional factors or failing to consider situational factors. (3 points)

In particular, what, if any, role do automatic versus controlled cognitive processes play in mitigating the issues discussed in #5? (2 points)

In: Psychology

Do you believe that the various definitions of terrorism contribute to the meaning of counterterrorism? Based...

  1. Do you believe that the various definitions of terrorism contribute to the meaning of counterterrorism?
  2. Based on the research you have conducted up to this point in the course, define counterterrorism in your own words.
  3. Do you believe that violence, fear, and intimidation are factors to consider when determining the interpretation of counterterrorism?
  4. Do you believe that mass terror and random terror are similar in nature? If so, why?

In: Operations Management

A 193 Ω resistor, a 0.750 H inductor, and a 6.00 μF capacitor are connected in...

A 193 Ω resistor, a 0.750 H inductor, and a 6.00 μF capacitor are connected in series across a voltage source that has voltage amplitude 28.5 V and an angular frequency of 245 rad/s . What is vR at t= 18.0 ms ? What is vL at t= 18.0 ms ? What is vC at t= 18.0 ms ?

In: Physics

In a rainy Summer day you observe a beautiful rainbow. Complete the following statements with greater...

In a rainy Summer day you observe a beautiful rainbow. Complete the following statements with greater than, less than, or equal to.

1. The wavelength of the light inside a raindrop is ... the wavelength of the same light in air.

2. The speed of the light inside a raindrop is ... the speed of light in air.

3. The frequency of the light inside a raindrop is ... the frequency of the same light in air.

In: Physics

how child sexual abuse is punished?

how child sexual abuse is punished?

In: Psychology

Describe one situation in which your own perceptions about someone were altered. What factors (as discussed...

Describe one situation in which your own perceptions about someone were altered. What factors (as discussed in your text and module) were at play as your perception changed?

Brainstorm at least 3 ways to learn empathy through doing (or “walking a mile in someone’s shoes”) for a group or position that is foreign to you.

As you reflect on the previous 2 questions, what can you do in the future to guard against inaccurate perceptions of people

In: Psychology

Explain the different type of framing effects: Strategic, Episodic & Thematic, & Emphasis

Explain the different type of framing effects: Strategic, Episodic & Thematic, & Emphasis

In: Psychology

Auditors have assessed inherent risk for a particular assertion at 80% and control risk at 5%....

Auditors have assessed inherent risk for a particular assertion at 80% and control risk at 5%. In addition they have performed audit procedures that they believe have a 25% risk of failing to detect a material misstatement in the assertion. Calculate the audit risk and explain what the audit risk means

In: Accounting

Consider the following case study: Clean Planet is a private business based in Victoria specialising in...

Consider the following case study: Clean Planet is a private business based in Victoria specialising in commercial cleaning supplies and business support products for organisational clients. Only a few computerized operations are in the business. In an effort to become more efficient and profitable, the vice president, Julia Thompson, has hired a systems analyst, Robert Hanover. Julia and Robert have made progress in the development of a strategic plan for Clean Planet. Robert is anxious to define the requirements for the new system. He has gathered more information and has created the following organization chart for Clean Planet. Robert: Julia, it’s time to start moving on the system investigation. The mission statement is finalized and strategic planning is well underway. I can see that the directors are beginning to think about how their departments can benefit from better information management. Julia: You’re right! Andrew McClean found out that we lost a big order the other day because the customer was able to get the estimate much more quickly from another company because of their online presence. He’s wondering just how many sales we are losing because of timeliness issues. I had Anna’s group gather numbers for the directors about how many times our profit margin has been reduced because of human error somewhere along the order process. We are profitable but could be more so by reducing error and becoming more competitive with timely information to our potential customers. Robert: Andrew’s area of sales is a logical place to start the investigation. I need to interview sales and customer service representatives to get an idea of the requirements for the new information system. What kind of information will we include? What do we want to get out? What processes need to be managed? What are our business needs? Charles Edwards President Julia Edwards Vice President Andrew McClean Director of Sales Anna McNally Director of Finance Martha Seymour Director of Operations Dennis Martin Shipping/Receiving Manager George Thompson Warehouse Manager Sales Rep (6) Accounting/Billing Clerk (2) Customer Service Rep (3) Julia: This will take some time, and a lot of information needs to be gathered. You should make sure you spend some time with the accounting clerks too because they fill in for customer service representatives. Robert: I’m ready to get started! Answer the following questions: a. Develop a fact-finding plan including interviews, documentation review, observation, questionnaires, sampling, and research. b. Review the organizational model above and list the individuals you would like to interview. Prepare a list of objectives for each of the interviews you will conduct. c. Prepare a list of specific questions for each individual you will interview.

In: Computer Science

dangerous nation by Robert kagan summary

dangerous nation by Robert kagan summary

In: Psychology

FRANCE - INTERNATIONAL BROADCASTING: Please outline a small summary of each heading in bullet point in...

FRANCE - INTERNATIONAL BROADCASTING:

Please outline a small summary of each heading in bullet point in regards to the country, FRANCE

Thank you :)

1. Background/History:

2. Cultue/Society:

3. Business/Monetisation:

4. Content/Regulations:

5. Delivery platforms and systems:

In: Operations Management

Suppose a city imposes a price floor on hamburgers sold at restaurants. (a) On a diagram...

Suppose a city imposes a price floor on hamburgers sold at restaurants.

(a) On a diagram show the resulting loss of total social surplus if rationing is efficient.

(b) Explain how the loss of total surplus would change if rationing were inefficient.

In: Economics

You will implement and test the sequence class using an array to store the sequence's items...

You will implement and test the sequence class using an array to store the sequence's items in C++. sequence1.h: The header file for the sequence class. Actually, you don't have to write much of this file. Start with the sequence1.h header file provided and add your name and other information at the top. Also, decide on appropriate private member variables, and declare these in the sequence class definition at the bottom of the header file. If some of your member functions are implemented as inline functions, then you may put those implementations in this file too. 2. sequence1.cxx: The implementation file for this first sequence class. You will write all of this file, which will have the implementations of all the sequence's member functions. // FILE: sequence1.h // CLASS PROVIDED: sequence (part of the namespace main_savitch_3) // There is no implementation file provided for this class since it is // an exercise from Section 3.2 of "Data Structures and Other Objects Using C++" // // TYPEDEFS and MEMBER CONSTANTS for the sequence class: // typedef ____ value_type // sequence::value_type is the data type of the items in the sequence. It // may be any of the C++ built-in types (int, char, etc.), or a class with a // default constructor, an assignment operator, and a copy constructor. // // typedef ____ size_type // sequence::size_type is the data type of any variable that keeps track of // how many items are in a sequence. // // static const size_type CAPACITY = _____ // sequence::CAPACITY is the maximum number of items that a sequence can hold. // // CONSTRUCTOR for the sequence class: // sequence( ) // Postcondition: The sequence has been initialized as an empty sequence. // // MODIFICATION MEMBER FUNCTIONS for the sequence class: // void start( ) // Postcondition: The first item on the sequence becomes the current item // (but if the sequence is empty, then there is no current item). // // void advance( ) // Precondition: is_item returns true. // Postcondition: If the current item was already the last item in the // sequence, then there is no longer any current item. Otherwise, the new // current item is the item immediately after the original current item. // // void insert(const value_type& entry) // Precondition: size( ) < CAPACITY. // Postcondition: A new copy of entry has been inserted in the sequence // before the current item. If there was no current item, then the new entry // has been inserted at the front of the sequence. In either case, the newly // inserted item is now the current item of the sequence. // // void attach(const value_type& entry) // Precondition: size( ) < CAPACITY. // Postcondition: A new copy of entry has been inserted in the sequence after // the current item. If there was no current item, then the new entry has // been attached to the end of the sequence. In either case, the newly // inserted item is now the current item of the sequence. // // void remove_current( ) // Precondition: is_item returns true. // Postcondition: The current item has been removed from the sequence, and the // item after this (if there is one) is now the new current item. // // CONSTANT MEMBER FUNCTIONS for the sequence class: // size_type size( ) const // Postcondition: The return value is the number of items in the sequence. // // bool is_item( ) const // Postcondition: A true return value indicates that there is a valid // "current" item that may be retrieved by activating the current // member function (listed below). A false return value indicates that // there is no valid current item. // // value_type current( ) const // Precondition: is_item( ) returns true. // Postcondition: The item returned is the current item in the sequence. // // VALUE SEMANTICS for the sequence class: // Assignments and the copy constructor may be used with sequence objects. #ifndef MAIN_SAVITCH_SEQUENCE_H #define MAIN_SAVITCH_SEQUENCE_H #include // Provides size_t namespace main_savitch_3 { class sequence { public: // TYPEDEFS and MEMBER CONSTANTS typedef double value_type; typedef std::size_t size_type; static const size_type CAPACITY = 30; // CONSTRUCTOR sequence( ); // MODIFICATION MEMBER FUNCTIONS void start( ); void advance( ); void insert(const value_type& entry); void attach(const value_type& entry); void remove_current( ); // CONSTANT MEMBER FUNCTIONS size_type size( ) const; bool is_item( ) const; value_type current( ) const; private: value_type data[CAPACITY]; size_type used; size_type current_index; }; } #endif

In: Computer Science