1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
SashulF [63]
2 years ago
7

Write a C function named apply_all that expects two arrays of integers and their sizes and dynamically allocates a new array of

integers whose size is the product of the 2 array sizes. The function should loop through the second array and multiplies each element across each element of array 1 and store the product in the newly created array. The function should return a pointer to the newly allocated array.
Computers and Technology
1 answer:
andrew-mc [135]2 years ago
5 0

Answer:

The function C is as follows:

int *apply_all(int arr1[], int arr2[], int size) {

  int result[size];

  for(int i =0; i<size;i++){

      result[i] = arr1[i] * arr2[i];

      printf(" %d", result[i]);

  }

  return result;

}

Explanation:

This line defines the function

int *apply_all(int arr1[], int arr2[], int size) {

This declares an array that holds the result of the function

  int result[size];

This iterates through the array

  for(int i =0; i<size;i++){

This multiplies the corresponding elements of both arrays

      result[i] = arr1[i] * arr2[i];

This prints the result of the multiplication

      printf(" %d", result[i]);

  }

This return the a pointer to the new array

  return result;

}

<em>See attachment for complete program that includes the main</em>

Download cpp
You might be interested in
What are some tasks for which you can use the VBA Editor? i need help for my computer class.
Murljashka [212]

Answer:

Visual Basic for Applications runs as an internal programming language in Microsoft Office applications such as Access, Excel, PowerPoint, Publisher, Word, and Visio. VBA allows users to customize beyond what is normally available with MS Office host applications by manipulating graphical-user-interface (GUI) features such as toolbars and menus, dialogue boxes, and forms. You may use VBA to create user-defined functions (UDFs), access Windows application programming interfaces (APIs), and automate specific computer processes and calculations. Macros can automate just about any task—like generating customized charts and reports, and performing word- and data-processing functions. Programmers,like replicating large pieces of code, merging existing program functions, and designing specific languages. VBA can also work in non-Microsoft settings by using a technology called "COM interface," which allows commands to interact across computer boundaries. Many firms have implemented VBA within their own applications, both proprietary and commercial, including AutoCAD, ArcGIS, CATIA, Corel, raw, and SolidWorks.

<em>(Hope this helps/makes sense!)</em>

6 0
3 years ago
What is a special class of adware that collects data about the user and transmits it over the Internet without the user’s knowle
Stells [14]

Answer:

The answer is "Spyware".

Explanation:

Spyware is a supplementary program that is mounted on your customer computer and it transmits the data without authorization via the Internet. Its business includes ads, private data, and improvements in the user interface, which is why it has become recognized as the special adware class that collects and transmits user information over the web without the user's permission.

7 0
3 years ago
Determine the best access modifier for each of the following situations: a. A class Employee records the name, address, salary,
Lorico [155]

Answer:

a. Protected

b. Public

Explanation:

There are four acess modifier in Java.

Default: Acessible only within the same package.

Public: Can be acessed by any class.

Private: Acessible only within the class.

For example, you have a class employee and a private method. This method can only be accessed by an object that is an instance of an employee.

Protected: Used in classes that extend each other. For example, a class of employees would extend employee.

So:

a. A class Employee records the name, address, salary, and phone number.

The best acesses modifier is protected. A class may extended employee but have the same arguments(name, adress, salary, phone number), so it should also have acess to the method.

b. An adding method inside of a class BasicMath.

This method can be used in a variety of packages and projects and classes... and there is no important information regarding security. So the best method is public.

4 0
3 years ago
What type would the object X be in the following statement:
Y_Kistochka [10]

Answer:

Boolean

Explanation:

If statement condition always returns true or false,which is a boolean data type.

X is true or false

it maybe a variable or an expression.

5 0
3 years ago
Read 2 more answers
What law formalizes many licensing arrangements used by the software industry and attempts to standardize their use from state t
andrew11 [14]

Answer: (C) Uniform Computer Information

Explanation:

  The uniform computer information is one of the type of transactional act is basically designed the various types of electronic commerce in the united states and by using this act it helps in recognizing the electronic contract by mention all the requirements.

  • The uniform computer information formalizing the various types of licensing arrangement and also standardize their specific use.  
  • In the united state, this model law specify their guidelines from state to another State.    

 According to the given question, the uniform computer information transaction act is used by the software organizations and developed for the purpose of regulate the computer data transactions products like the online based database management and software.    

8 0
3 years ago
Other questions:
  • Yet another variation: A better packet switched network employs the concept of acknowledgment. When the end user’s device receiv
    11·1 answer
  • You want to place a video from the internet to your desktop. what process do you use?
    15·1 answer
  • Remy’s manager has asked him to change the background color scheme from reds to blues in the standard template the company uses
    15·2 answers
  • You install a teanviewer on your work station at home so that you can access it when on the road. How can you be assured that un
    12·1 answer
  • An application with which you can perform calculations on numbers and work with other data
    8·1 answer
  • Experienced students may serve as mentors if they are at least age 21 and have at least 3 years of post-secondary education. In
    5·1 answer
  • [1] Please find all the candidate keys and the primary key (or composite primary key) Candidate Key: _______________________ Pri
    6·1 answer
  • Use the_____icon to insert a new record.<br><br> A. *<br> B. X<br> C. =<br> D. &amp;
    11·1 answer
  • How are keyboards applied in the real world
    13·1 answer
  • Which version of HTML provides the lowest common denominator of HTML tags
    8·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!