0% found this document useful (0 votes)
4 views1 page

Java Exercises Arrays

The document contains two Java programming exercises. The first exercise involves creating a two-dimensional integer array with methods for filling, printing, summing rows, and finding the minimum value. The second exercise focuses on generating and displaying Pascal's triangle with specific rules for its construction.
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
4 views1 page

Java Exercises Arrays

The document contains two Java programming exercises. The first exercise involves creating a two-dimensional integer array with methods for filling, printing, summing rows, and finding the minimum value. The second exercise focuses on generating and displaying Pascal's triangle with specific rules for its construction.
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

Java Exercises

Question-1:
Write a java application to manipulate an integers array of 2 dimensions of 4 rows
and 5 columns ; implements the following methods :
1-fillArrays(int[][] t) : to fill the array with random values between 1 and 100
2-printArrays(int[][] t ) : to print the array
3-sumRows(Int[][] t) : that compute and display sum and average of each row
4-minValue(Int[][] t ) that return the min values of the array
5-the main method that calls all previous methods
Question-2:
g
Write a java application to create and displays the
pasacal triangle : the pascal triangle is created as 1
follows: 1 1
1 2 1
1- All elements of diagonal are set to 1 1 3 3 1
2- All elements in first column are set to 1
3- Others elements under 1st diagonal are
calculated as :t[i][j]=t[i-1][j]+t[i-1][j-1]

You might also like