Create a function that carries out the desired action

Assignment Help Programming Languages
Reference no: EM13771923

Create your own assignment to get more practice with arrays. Listed below are twenty seven functions you can write that deal with arrays. Listed next to each function is a number of points each is worth in parenthesis. You must choose enough functions to add up to 15 points! You can choose to do more, but you will only get up to 15 points for this assignment.

For each of the following:

-You must create a function that carries out the desired action. Please keep in mind that printing should not be done in your functions!

-You should provide enough code in main to test each of your functions. You may use prepopulated arrays in main to pass into each of your functions, and you can print them out in main (or write an array printing function!)

Anyone who successfully completes and demonstrates ALL 27 functions will receive 15 extra credit points on this assignment (30/15).

1) Subtract two arrays, store the result in a third array.

2) Multiply two arrays, store the result in a third array.

3) Divide two arrays, store the result in a third array.

4) Add two 2D arrays, store the result in a third 2D array.

5) Subtract two 2D arrays, store the result in a third 2D array.

6) Multiply two 2D arrays, store the result in a third 2D array.

7) Divide two 2D arrays, store the result in a third array.

8) Average all the elements in an array.

9) Average all the elements in a 2D array.

10) Reverse the values in an array.

11) Transpose a 2D array. (Rows become columns, columns become rows)

12) Compress an array by averaging pairs of elements. For example, compressing array [1, 3, 8, 7, 5] produces array [2, 7.5, 5]

13) Produce the sum of the elements on the main diagonal of a square array.

14) Produce the product of the elements on the main diagonal of a square array.

15) Find the minimum element in a 2D array.

16) Find the maximum element in a 2D array.

17) Shift an array left or right by a number of positions. Elements shifted out are lost. Elements shifted in are zeros. For example, given array [2, 4, 6, 8, 9] shifted right by 2 produces array [0, 0, 2, 4, 6]. Shifting the original array left 1 produces array [4, 6, 8, 9, 0].

18) A 2D array exhibits Row Magic (every row has the same sum) (Return 1 or 0 for yes or no)

19) A 2D array exhibits Column Magic (every column has the same sum) (Return 1 or 0 for yes or no)

20) Insert an element in an array at a given position, and shift elements down. The last element will 'fall off' the array. For example, given array [3, 4, 6, 7, 8] Insert 1 at index 2 results in array [3, 4, 1, 6, 7].

Reference no: EM13771923

Questions Cloud

Determine the time of death : There is a difference between a crime scene investigator and a coroner's investigator. There is also a difference between a coroner and a medical examiner. There are 3 ways to determine the time of death
How can starbucks maintain its commitment to reducing waste : Control is achieved when behavior and work procedures conform to standards and goals are accomplished. By contrast, control loss occurs when behavior and work procedures do not conform to standards. To determine whether control is worthwhile, manager..
Find a recent osha violation in a healthcare setting : Using the internet, research and find a recent OSHA violation in a healthcare setting. Using your own writing, summarize the case in 1 or 2 paragraphs
What is the theoretical number of moles : Using the principles of stoichiometry, determine the second product from the reaction: 2 C7H6O3 + C4H6O3 -> 2 C9H8O4 - What is the theoretical number of moles of the organic product.
Create a function that carries out the desired action : Create your own assignment to get more practice with arrays. Listed below are twenty seven functions you can write that deal with arrays. Listed next to each function is a number of points each is worth in parenthesis. Create a function that carri..
Impact of conducting business : State your opiniuon regarding the impact of conducting business with this country and the ramifications of doing so or not doing so. (a). State what your recommendations will be to the CEO of your company and support your recommendation.
How the world trade organization handles dispute resolution : Explain how the World Trade Organization handles dispute resolution. How do conflict of law provisions help promote international commerce
Laws of international business practices : What kind of impact can countries with poor track records of adhering to the laws of international business proactices have on global economy? Explain.
Safety and health team of a construction company : State the major players that make up the safety and health team of a construction company, and explain the roles of each person in the safety and health plan. Identify four examples of forces that have been influential in changing the nature of th..

Reviews

Write a Review

Programming Languages Questions & Answers

  Write a haskell program to calculates a balanced partition

Write a program in Haskell which calculates a balanced partition of N items where each item has a value between 0 and K such that the difference b/w the sum of the values of first partition,

  Create an application to run in the amazon ec2 service

In this project you will create an application to run in the Amazon EC2 service and you will also create a client that can run on local machine and access your application.

  Explain the process to develop a web page locally

Explain the process to develop a Web page locally

  Write functions

These 14 questions covers java class, Array, link list , generic class.

  Programming assignment

If the user wants to read the input from a file, then the output will also go into a different file . If the user wants to read the input interactively, then the output will go to the screen .

  Write a prolog program using swi proglog

Write a Prolog program using swi proglog

  Create a custom application using eclipse

Create a custom Application Using Eclipse Android Development

  Create a application using the mvc architecture

create a application using the MVC architecture. No scripting elements are allowed in JSP pages.

  Develops bespoke solutions for the rubber industry

Develops bespoke solutions for the rubber industry

  Design a program that models the worms behavior

Design a program that models the worm's behavior.

  Writing a class

Build a class for a type called Fraction

  Design a program that assigns seats on an airplane

Write a program that allows an instructor to keep a grade book and also design and implement a program that assigns seats on an airplane.

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd