Ask Question, Ask an Expert

+61-413 786 465

info@mywordsolution.com

Ask Programming Language Expert

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].

Programming Language, Programming

  • Category:- Programming Language
  • Reference No.:- M91341683
  • Price:- $45

Guranteed 36 Hours Delivery, In Price:- $45

Have any Question?


Related Questions in Programming Language

Task working with arraysoverviewin this task you will

Task: Working with Arrays Overview In this task you will create a simple program which will create and work with an array of strings. This array will then be populated with values, printed out to the console, and then, w ...

Background informationthis assignment tests your

Background Information This assignment tests your understanding of and ability to apply the programming concepts we have covered throughout the unit. The concepts covered in the second half of the unit build upon the fun ...

Assignment - horse race meetingthe assignment will assess

Assignment - Horse Race Meeting The Assignment will assess competencies for ICTPRG524 Develop high level object-oriented class specifications. Summary The assignment is to design the classes that are necessary for the ad ...

Task silly name testeroverviewcontrol flow allows us to

Task: Silly Name Tester Overview Control flow allows us to alter the order in which our programs execute. Building on our knowledge of variables, we can now use control flow to create programs that perform more than just ...

Assignmentquestion onegiving the following code snippet

Assignment Question One Giving the following code snippet. What kind of errors you will get and how can you correct it. A. public class HelloJava { public static void main(String args[]) { int x=10; int y=2; System.out.p ...

Question 1 what is hadoop explaining hadoop 2 what is

Question: 1. What is Hadoop (Explaining Hadoop) ? 2. What is HDFS? 3. What is YARN (Yet Another Resource Negotiator)? The response must be typed, single spaced, must be in times new roman font (size 12) and must follow t ...

Task - hand execution of arraysoverviewin this task you

Task - Hand Execution of Arrays Overview In this task you will demonstrate how arrays work by hand executing a number of small code snippets. Instructions Watch the Hand Execution with Arrays video, this shows how to ste ...

Assignment task -q1 a the fibonacci numbers are the numbers

Assignment Task - Q1. (a) The Fibonacci numbers are the numbers in the following integer sequence, called the Fibonacci sequence, and are characterised by the fact that every number after the first two is the sum of the ...

Extend the adworks applicationi add dialogs to allow the

Extend the AdWorks application I. Add Dialogs to allow the user to Add, Edit, Read and Delete a Customer and refresh the view accordingly. 1. The user should be able to select a specific customer from the DataGrid and cl ...

Question - create a microsoft word macro using vba visual

Question - Create a Microsoft Word macro using VBA (Visual Basic for Applications). Name the macro "highlight." The macro should highlight every third line of text in a document. (Imagine creating highlighting that will ...

  • 4,153,160 Questions Asked
  • 13,132 Experts
  • 2,558,936 Questions Answered

Ask Experts for help!!

Looking for Assignment Help?

Start excelling in your Courses, Get help with Assignment

Write us your full requirement for evaluation and you will receive response within 20 minutes turnaround time.

Ask Now Help with Problems, Get a Best Answer

Why might a bank avoid the use of interest rate swaps even

Why might a bank avoid the use of interest rate swaps, even when the institution is exposed to significant interest rate

Describe the difference between zero coupon bonds and

Describe the difference between zero coupon bonds and coupon bonds. Under what conditions will a coupon bond sell at a p

Compute the present value of an annuity of 880 per year

Compute the present value of an annuity of $ 880 per year for 16 years, given a discount rate of 6 percent per annum. As

Compute the present value of an 1150 payment made in ten

Compute the present value of an $1,150 payment made in ten years when the discount rate is 12 percent. (Do not round int

Compute the present value of an annuity of 699 per year

Compute the present value of an annuity of $ 699 per year for 19 years, given a discount rate of 6 percent per annum. As