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

  Program-calculate power loss-transmitted-power generating

Write a program to calculate power loss in transmission line with resistance of 0.05 ohms/mile. Calculate power loss if 500 kW of power is transmitted from power generating station.

  Write a program to enter series of numbers

Write a program that ask the user to enter a series of numbers ending with -1. After the -1 is input, program should print how many numbers are even and how many numbers are odd.

  Create program by using pseudocode along with structure

Create a program by using pseudocode along with structure to do the following. Permit the user to enter series of temperatures in degrees Celsius (C) terminated by -999.

  Falling letters game

Generic queue in the first project and generic list in the second project - In the second project, the player clicks the mouse on any falling letter to remove that letter from the window.

  Develops bespoke solutions for the rubber industry

Develops bespoke solutions for the rubber industry

  Write program to display company payroll report in list box

Write a program that display a company payroll report in a list box. the program should read each employees name, hourly rate and hours worked from a file and produce a report.

  Shows the graphic simulation of the elevator

The elevator could be called from level 2 by the external call button IP0 being pressed. The elevator doors should then close via OP3, once closed IP5 (doors closed sensor) should energise.

  Design a logic for a program which allows a user to enter

design a logic for a program that allows a user to enter 15 numbers then display each number and its difference from

  Write a program that prompts for and reads an amount

Write a program that prompts for and reads an amount (integer) for Canadian dollars and convert the amount to Euros. The exchange rate is 1.

  Advantages of contemporary languages allow kinds of comments

Many contemporary languages allow two kinds of comments, one in which delimiters are used on both ends (for multiple line comments), and one in which a delimiter marks only the beginning of the comment.

  Computing return value after execution of program

Compute return value of Antony after its execution?

  Pseudo code for recursive function to print prime numbers

Write in pseudo code the recursive function which receive 2 integers (a and b) and returns sum of all common prime dividers (1 is not prime).

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