Search Header Logo

K1 - Pemrograman Web

Authored by Muhammad Davi

Computers

University

Used 6+ times

K1 - Pemrograman Web
AI

AI Actions

Add similar questions

Adjust reading levels

Convert to real-world scenario

Translate activity

More...

    Content View

    Student View

10 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

10 sec • 1 pt

Berikut beberapa aturan penamaan variabel, aturan yang benar pada bahasa pemrograman PHP adalah?

1. Diawali dengan karakter dolar ($) dan diikuti dengan nama pengenal

  1. 2. Nama pengenal dimulai dengan huruf atau garis bawah (_)

  2. 3. Boleh diawali dengan angka

    4. Tidak boleh mengandung spasi

  3. 5. Bersifat case sensitive (huruf besar dan kecil dibedakan)

  4. 6. Tidak ada minimal karakter

1-2-3-4-5-6

1-2-3-4-5

1-3-4-5-6

1-2-4-5

2.

MULTIPLE CHOICE QUESTION

10 sec • 1 pt

Format percabangan if - elseif - if yang benar adalah?

if (ekspresiA) {

statement1;

} else if (ekspresiB) { statement2;

}

if (ekspresiA) {

statement1;

} else if (ekspresiB) {

statement1;

} else {

statement1;

}

if (ekspresiA)

statement1;

} elseif (ekspresiB) {

statement1;

} else {

statement1;

}

if (ekspresiA) { statement1;

} elseif (ekspresiB) {

statement2;

} else {

statement3;

}

3.

MULTIPLE CHOICE QUESTION

10 sec • 1 pt

Format percabangan switch yang benar adalah?

switch ($variable) {

case value_1:{

statement1;

break;

}

default{

statement3;

break;

}

switch ($variable) {

case value_1:

statement1;

break;

case value_2:

statement2;

break;

default:

statement3;

break;

}

switch ($variable) {

case value_1:

statement1;

break;

defeult:

statement3;

break;

}

switch ($variable)

case value_1:

statement1;

break;

case value_2:

statement2;

break;

default:

statement3;

break;

4.

MULTIPLE SELECT QUESTION

10 sec • 1 pt

Format perulangan for dan foreach yang benar adalah? (pilih 2)

for (increment; condition; inisialisasi) {

}

for (inisialisasi; condition; increment) {

statement;

}

foreach ($var_array as $var) {

statement;

}

foreach ($var_array as $var)

statement;

}

5.

MULTIPLE SELECT QUESTION

10 sec • 1 pt

Format perulangan while dan do while yang benar adalah? (pilih 2)

while(inisialisasi;) {

statement;

increment;

}

inisialisasi;

do {

statement;

increment;
} while(condition)

do (inisialisasi;) {

increment;
} while(condition)

inisialisasi; while(condition) {

statement;

increment;

}

6.

MULTIPLE CHOICE QUESTION

10 sec • 1 pt

Media Image

Fungsi tambahSatu tersebut menghasilkan output?

Error

$a

5

6

7.

MULTIPLE CHOICE QUESTION

10 sec • 1 pt

Kode untuk membuat array yang benar adalah?

$nama = array["Nafisah", "Luthfi", "Maisha", "Faiza"];

$nama = ("Nafisah", "Luthfi", "Maisha", "Faiza");

$nama = {"Nafisah", "Luthfi", "Maisha", "Faiza"}

$nama = array("Nafisah", "Luthfi", "Maisha", "Faiza");

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

Classlink

Continue with Classlink

Clever

Continue with Clever

or continue with

Microsoft

Microsoft

Apple

Apple

Others

Others

Already have an account?