Các bài tập workshop và PE có lời giải của ngôn ngữ Java
Chúng mình đã tổng hợp lại các bài workshop và đề mẫu PE của ngôn ngữ Java để các bạn có thể tham khảo tránh việc bỡ ngỡ qua đó có thể luyện tập để có một mùa thi PE tốt đẹp nhất. Workshop1: Đề bài: Write a Java program that will accept a matrix of integers then this matrix will be printed out and the sum of values and average of values are printed also. The user interface may be: Enter number of rows: 2 Enter number of columns: 3 Enter the matrix m[0][0]=1 m[0][1]=2 m[0][2]=3 m[1][0]=4 m[1][1]=5 m[1][2]=6 Matrix inputted: 1 2 3 4 5 6 Sum: 21 Average: 3.5 Hint: Use System.out.format("%3d", n); Hướng dẫn: Step1: Input the matrix Step2: G et the sum of values Step3: G et the average of values - You will add the code “System.out.println("Average:" +(float)sum/(rows*cols));” Workshop2: Đề bài: Write a Java program that will accept two float numbers and an operator (+-*/) then the program will print out the result...