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

  Building instruction set simulators

Building Instruction Set Simulators

  Creating main function that opens the input file

Create a main function that opens the input file, reads each line, and based on first character in input line, calls the [A]dd function or [M]ultiply function.

  Discuss what is meant by low-level programming

Discuss what is meant by "low-level" programming. What are the advantages of assembly language over higher-level languages for this type of programming?

  Issues into account for collecting user data via forms

In addition to making our forms easy to use we need to consider user privacy and the use of data. What are some of the issues which you believe you require to take into account for collecting user data via forms?

  Define function that takes year as it-s input argument

Define and call a function fast_food_billions that takes the year as it's input argument and returns the prediction as it's result. Tell the user that entry of a year before 2005 will cause the program to stop.

  Develop logic for program to read customer records

Develop the logic for a program that reads in 100 customer records and stores the first and last name and total purchases in three parallel arrays.

  Which of the following is not included in a pseudocode

Which of the following is not included in a pseudocode program?

  Write pseudocode

Write pseudocode that represents the abstract functions of the enqueue and dequeue operations. Define and explain any supplementary information needed by your pseudocode.

  Write down a program which explores the seating patterns

write a program that explores the seating patterns related to course performance by using an array of student scores.

  Generate a salary as a number with two digits

Generate a salary as a number with two digits after the decimal point. The salary for a teacher should be in the range from $40,000 to 70,000.

  Explaining variable in an arrays of ints

Assume that variable A is an arrays of ints. Consider the following code segment.

  Learn to use some basic commands

In this lab you will learn to use some basic commands of the gedit, nano, and vim editors, with emphasis on vim.

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