[SOLVED] CSc20: Programming Concepts and Methodology II Lab03

35.00 $

Category:
Click Category Button to View Your Next Assignment | Homework

You will receive the following solution file(s) instantly after successful payment:

zip file icon Lab03-uxlkbm.zip (272.8 KB)
Assignment Instructions Updated Recently? Submit Below and we will provide new Solution!
Submit New Instructions
🔒 Securely Powered by:
Secure Checkout
Rate this product

This lab gives you exercises with using two dimensional arrays of Java and practices with using methods that return arrays. What you should do is to download and complete the instructor’s program lab03.java:

  1. Implement print2D(A) so that it prints out its 2D array argument A in the matrix form.
  2. Implement add2Ds(A,B) so that it creates and returns a new 2D array C such that C=A+B.
  3. Implement multiScalar2D(c,A) so that it creates and returns a new 2D array B such that B=c×A.
  4. Implement transpose2D(A), which creates and returns a new 2D array B such that B is the transpose of A.

Your output should look like the following:

  • =
    • 2 3   4

5   6   7   8

9  10  11  12

 

  • =

 

  • 4 6   8

10  12  14  16

18  20  22  24

 

A + B =

 

3   6   9  12

15  18  21  24

27  30  33  36

 

 

5 X A =

 

5  10  15   20

25  30  35   40

45  50  55   60

 

 

Transpose of A =

 

  • 5 9
  • 6 10
  • 7 11
  • 8 12

 

 

Note that your methods should work for 2D arrays of any sizes.

  • Lab03-uxlkbm.zip