Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Information Sciences and Technologies Name: ISTE-120 Lab 10: 2-Dimensional Arrays Note: All Exercises must be completed during the lab period. Exercise 1-Grid sums (5 points)

image text in transcribed
image text in transcribed
Information Sciences and Technologies Name: ISTE-120 Lab 10: 2-Dimensional Arrays Note: All Exercises must be completed during the lab period. Exercise 1-Grid sums (5 points) 1. Download the file GridPractice.zip from myCourses that unzips to a file named GridPractice.java. There are no other classes as all code will be in the main method After the user enters a size, the program creates a 2-dimensional array (named grid) with the size to specify the number of rows and columns. To avoid typing a great deal of input, the program stores random numbers between 0..99 into each position in grid. 2. Write the code to print the contents of the grid as shown in the Sample Output. To have the columns align, you will need to use the printf command. 3. When the program works correctly, have the instructor or TA check the code and initialize. Have instructor or TA sign here when Exercise 1 works correctly. Exercise 2- Row and Column Sums (3 points) 4. Write the code to calculate and print the sum of each row and each column. (See Example). Have instructor or TA sign here when Exercise 2 works correctly. Exercise 3- Diagonal Sums (2 points) Write the code to calculate and print the sum of the two diagonals. Assume that the size is 3. One diagonal starts in the upper left corner( [0] [0]) and ends in the lower right corner ( 121 12] ). The other diagonal starts in the upper right corner ( [01 12])and end in the lower left corner ( [2] [0]) 5. Have instructor or TA sign here when Exercise 3 works correctly

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Systems Design Implementation And Management

Authors: Peter Rob, Carlos Coronel

3rd Edition

0760049041, 978-0760049044

More Books

Students also viewed these Databases questions