n array of nums stores the following values in the range of 1-5:
Write a Java program to store the above values in the array. Then, the following output will be produced by the program. Your program must use a loop and selection structure such as if-else.
1: 0
2: 1
3: 2
4: 3
5: 1
[Explanation about the output: There are no 1’s in the array nums, there is one 2, there are two 3’s, there are three 4’s, and there is one 5]
Suatu tatasusunan nums menyimpan nilai-nilai berikut dalam julat 1-5:
Tuliskan satu aturcara Java untuk menyimpan semua nilai di atas dalam tatasusunan. Kemudian, output berikut akan dipaparkan oleh aturcara ini. Aturcara anda mesti menggunakan gelung dan struktur pilihan seperti if-else.
1: 0
2: 1
3: 2
4: 3
5: 1
[Penjelasan berkenaan output: Tiada nilai 1 dalam tatasusunan nums, terdapat satu 2, ada dua 3, tiga 4 dan satu 5]
QUESTION 2
Complete the THREE tasks below/ Lengkapkan TIGA task berikut.
TASK 1
On the course page of this course in my inspire, click “Explore 1” as shown below.
Then, do the following activities:
Do the Pre-Test (1)
Note: The post-test will only appear after you have completed the pre-test and “explorelet”