Create a two dimensional array called matrix

Assignment Help Data Structure & Algorithms
Reference no: EM131135926

Assignment

Create a two dimensional array called Matrix1 of size 3X3.

Populate it with 1 through 9.

Print Matrix1 row by row, it must look like:

1

2

3

4

5

6

7

8

9

Declare another array of same size called Matrix2

Transpose the contents of Matrix1 into Matrix2.

Print Matrix2 which must look like:

1

4

7

2

5

8

3

6

9

Transpose of an array is when the contents of the row and column are reversed.  No extra variables are allowed.  No hardcoding is acceptable.  You must accomplish this with as few lines of code as possible.

Create a two dimensional array called Matrix1 of size 3X3.

Populate it with 1 through 9.

Print Matrix1 row by row, it must look like:

1

2

3

4

5

6

7

8

9

Pass Matrix1 to a function called diagonal, in which you will change only the diagonal values to zero.

Print Matrix1 which now looks like:

0

2

3

4

0

6

7

8

0

No extra variables are allowed.  No hard coding is acceptable.  You must accomplish this with as few lines of code as possible.

Reference no: EM131135926

Questions Cloud

What lessons could you take from the business concepts : What lessons could you take from the business concepts of fixed and variable costs? And do you factor in the value of your time when you price comparison shop? Why or why not?
Difference between charismatic and transformationl leader : From the e-Activity, compare and contrast the difference between a charismatic leader and a transformational leader. Determine whether you are a charismatic or a transformational leader. Provide a rationale for your response.
What federal and state agencies are required to deal : What federal and state agencies are required to deal with an MCI resulting from a terrorist attack - how do you distinguish between federal and state authorities for both operational and management functions? Explain.
Considering purchasing an automatic sprinkler system : RealTurf is considering purchasing an automatic sprinkler system for its sod farm by borrowing the entire $20,000 purchase price. The loan would be repaid with four equal annual payments at an interest rate of 12%/year. It is anticipated that the ..
Create a two dimensional array called matrix : Create a two dimensional array called Matrix1 of size 3X3. Declare another array of same size called Matrix2. Transpose the contents of Matrix1 into Matrix2.
Describe the various steps you would take in conducting : Assume you are consulting and you have been asked to conduct a comprehensive assessment to determine the training and development needed to elevate the performance of 25 employees in a sales support call center.
Do you support or are you against a national healthcare plan : Do you support or are you against a national healthcare plan and why and Is there a particular healthcare plan (IN U.S.A) that you favor over another ?
About her relationship with another man : Explain whether each of the following losses would be covered under Section II in the homeowners policy. If the loss is not covered, explain how coverage can be obtained.
Compare your spreadsheet’s solution to the answer : Modify the spreadsheet in Sidebar 5-1 to handle recovery periods up to 10 years. Test your spreadsheet by entering the data from Example 5-1 and Problems 1 and 2. Compare your spreadsheet’s solution to the answer to these problems.

Reviews

Write a Review

Data Structure & Algorithms Questions & Answers

  Calculate a three quarter moving average forecast

The Fastgro Fertilizer Corporation distributes fertilizer to various lawn and garden shops. Calculate a three-quarter moving average forecast for quarters 4 through 13 and calculate the forecast for each quarter.

  Give algorithm-correctness proof-time complexity for tree

Determine the minimum number of nodes in tree to remove so that the tree is separated into subtrees of sizes at most k. Give the algorithm, the correctness proof and the time complexity.

  Show how the box can be used to factor n

That is, given a quadratic residue y, the box outputs an x with x2 = y (equation is modulo n). Show how the box can be used to factor n.

  Define the three types of shortest path problems

Why did Binomial heaps NOT require the mark bits and the rules about losing two children - Determine whether it is possible to draw a circle centered at the origin containing two or more of the points on its boundary.

  Calculate halstead''s basic measures on the factorial code

Calculate Halstead's basic measures on the triangle code from Problem 5 and Calculate Halstead's basic measures on the factorial code given below:

  Algorithm to compute binomial coefficients

Analyze the time taken by this algorithm under the unreasonable assumption that the addition C(n-1, k-1) + C(n - 1, k) can be carried out in constant time once both C(n-1, k-1) and C(n - 1, k) have been obtained recursively.

  Explain the advantage of using arrays as the primary index

Explain the advantage of using Arrays as the primary index. Now, state which DS you would use for the primary index and why?

  Describe the steps that would use in order to convert data

Describe the steps that you would use in order to convert database tables to the First Normal Form

  Implement a method to delete every node from your bst

Implement a method to delete every node from your BST that contains a word that is 3 or fewer letters long (note that you must explicitly make these deletions, not fail to insert these words in the first place).

  How to find local minimum of t using only o(log n) to node t

A node v of T is a local minimum if the label x_v is less than the label x_w for all nodes w that are joined to v by an edge.

  Question related to ms excel

Discuss how do I insert a row in multiple tables on different sheets in the same workbook? I have twelve sheets, one for every month, and the sheets are exactly the same.

  What would happen if that information were compromised

What rights to privacy do people have when using the Internet at home? Are their privacy rights limited? Do those same rights and limits exist at work? Explain your answer.

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