Java Bài tập mới nhất

3 348 0
Java Bài tập mới nhất

Đang tải... (xem toàn văn)

Thông tin tài liệu

Java Bài tập Java Bài tậpJava Java Bài tập Java Bài tậpJava Java Bài tập Java Bài tậpJava Java Bài tập Java Bài tậpJava Java Bài tập Java Bài tậpJava Java Bài tập Java Bài tậpJava Java Bài tập Java Bài tậpJava Java Bài tập Java Bài tậpJava Java Bài tập Java Bài tậpJava

Exercises of Week 08 Note: Use Math.random() to create random number Example: Create and print to screen a nxn matrix (with n>=3) Hint: public class Ex{ public static void main(String [] arg){ int n=3; int a[][]=new int[n][n]; //Create random numbers from to 99 for(int i=0;i=3), please: a) Print a series of numbers is the square numbers in the matrix and average of those numbers b) Find the minimum square number (min) and maximum (max) is based on range finding, printing out square numbers lying in the interval [min, max] Give a 5x5 matrix (or nxn, with n>=3), please: a) Find the smallest number (min) and maximum (max) on the main diagonal of the matrix Exercises of Week 08 b) Based on the results of and max, print out all the primes in the interval [min, max] is not in the matrix Give a 5x5 matrix (or nxn, with n>=3), please: a) Find the smallest number (min) and maximum (max) on the secondary diagonal of the matrix b) Based on the results of and max, print out all the even square numbers in the interval [min, max] Give a 5x5 matrix (or nxn, with n>=3), please: a) Print all the odd integers in the matrix b) Determine the smallest and largest numbers based on a sequence of question a c) Based on the minimum (min) and maximum (max) in question b, print out the odd integers in the interval [min, max] is not in sequence of question a Give a 5x5 matrix (or nxn, with n>=3), please: a) Find the smallest prime number (min) and maximum (max) in the matrix b) Based on the above results, print out all the prime numbers in the interval [min, max] Give a 5x5 matrix (or nxn, with n>=3), please: a Calculate sum the smallest integers on each line of the matrix b Calculate sum the largest integers on each line of the matrix

Ngày đăng: 23/10/2016, 14:52

Tài liệu cùng người dùng

Tài liệu liên quan