Search Header Logo

Sains Komputer Tingkatan 5 - 3.1.8 Penggunaan Tatasusunan

Authored by Mohd Nasaruddin

Computers

1st - 12th Grade

Used 48+ times

Sains Komputer Tingkatan 5 - 3.1.8 Penggunaan Tatasusunan
AI

AI Actions

Add similar questions

Adjust reading levels

Convert to real-world scenario

Translate activity

More...

    Content View

    Student View

5 questions

Show all answers

1.

FILL IN THE BLANKS QUESTION

1 min • 1 pt

Penggunaan adalah untuk menyimpan satu senarai nilai dalam satu pemboleh ubah

(a)  

2.

FILL IN THE BLANKS QUESTION

1 min • 1 pt

Nilai awalan semasa pengisytiharan:


var no = [5,-1,4,12,8];


Berdasarkan sintaks di atas, apakah nilai bagi no[0]?

(a)  

3.

FILL IN THE BLANKS QUESTION

1 min • 1 pt

Berikut adalah sintaks untuk mendapatkan nombor dalam senarai satu per satu dan menjumlahkannya.


<html>

<body>

<script>

var no = [5, -1, 4, 12, 8];

var jumlah = 0;

jumlah = no[0] + no[1] + no[2] + no[3] + no[4];

document.write (jumlah);

</script>

</body>

</html>


Berdasarkan aturcara di atas, berapakah nilai output bagi jumlah?

(a)  

4.

FILL IN THE BLANKS QUESTION

1 min • 1 pt

Berikut adalah sintaks untuk menggunakan ulangan untuk mendapatkan nombor dalam senarai dan menjumlahkannya.


<html>

<body>

<script>

var no = [5, -1, 4, 12, 8];

var jumlah = 0;

var i;

for (i=0; i<5; i++)

{

jumlah = jumlah + no[i];

}

document.write (jumlah);

</script>

</body>

</html>


Berdasarkan aturcara di atas, berapakah nilai output bagi jumlah?

(a)  

5.

FILL IN THE BLANKS QUESTION

1 min • 1 pt

Berikut adalah atur cara untuk mencari nilai daripada suatu senarai nombor dalam tatasusunan..


<html>

<body>

<script>

var no = [5, -1, 4, 12, 8];

var i;

for(i=0; i<5; i++)

{

if (no[i] == 5)

document.write (no[i]);

}

</script>

</body>

</html>


Berdasarkan aturcara di atas, berapakah nilai outputnya?

(a)  

Access all questions and much more by creating a free account

Create resources

Host any resource

Get auto-graded reports

Google

Continue with Google

Email

Continue with Email

Microsoft

Continue with Microsoft

or continue with

Facebook

Facebook

Apple

Apple

Others

Others

Already have an account?