subject

This assignment is to teach the creation and processing of 2-dimensional int arrays. Assume that "intar" is a 2-dimensional int array (made out of rows and columns as in pages 289-321), which contains the following int values:

10 13 26 34 60 90
25 46 57 88 77 91
29 30 41 52 82 92
Write a java program that you will call Assign8.java that has a main method and declares:

The above two-dimensional array intar properly as is.(5 points)

A method printArrayAsIs() which has no parameter and returns nothing and is implemented as follows:
public static void printArrayAsIs(){}
Use a nested for loop (two consecutive for loops) to print the 2 dimensional array intar declared above in the exact following order (use the nested for loop in page 291 as an example) (10 points):
10 13 26 34 60 90 25 46 57 88 77 91 29 30 41 52 82 92
printArrayAsIs() is called from main(). (10 points)

A method printArrayColumnWise() which has not parameter and returns nothing and is implemented as follows:
public static void printArrayColumnWise(){}
uses a nested for loop( two consecutive for loops) to print the 2 dimensional array intar declared above in the exact following order (use the nested for loop in page 291 as an example) (25 points):
10 25 29 13 46 30 26 57 41 34 88 52 60 77 82 90 91 92
That is: to print the values of intar going across the columns instead of across the rows.
printArrayColumnWise() is called from the main() method. (10 points)

A method sumDifference() which has no parameter and returns nothing and is implemented as follows:
public static void sumDifference(){}
uses a nested for loop( two consecutive for loops) to print the sum of the elements of intar declared above in the exact following order (use the nested for loop in page 291 as an example) (30 points):
10 - 13 + 26 - 34 + 60 - 90 + 25 - 46 + 57- 88 + 77- 91 + 29 - 30 + 41 - 52 + 82 - 92
That is: to print the final result of the sum of elements as calculated above = -129
sumDifference() is called from the main() method. (10 points)

ansver
Answers: 2

Other questions on the subject: Computers and Technology

image
Computers and Technology, 22.06.2019 15:20, brookemcelhaney
The north and south regions had very diferent economies in the 1800s.
Answers: 1
image
Computers and Technology, 22.06.2019 18:30, lailahussain99
Which of the following is an example of intellectual properly! oa. new version of a novelb. journal of ideasc. pages of a bookood. lines of a poem
Answers: 2
image
Computers and Technology, 23.06.2019 14:30, naomi20044
Select the correct answer. andy received a potentially infected email that was advertising products. andy is at risk of which type of security threat? a. spoofing b. sniffing c. spamming d. phishing e. typo-squatting
Answers: 2
image
Computers and Technology, 23.06.2019 18:30, emmaishere69
List 3 items that were on kens resume that should have been excluded
Answers: 1
You know the right answer?
This assignment is to teach the creation and processing of 2-dimensional int arrays. Assume that "i...

Questions in other subjects:

Konu
Mathematics, 23.04.2020 08:44
Konu
Mathematics, 23.04.2020 08:44