Fundamentals of Computer Science
Quiz
•
Computers
•
2nd Grade
•
Medium
hani r
Used 16+ times
FREE Resource
Enhance your content
20 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Apakah tujuan ulangan 'for' dalam pengaturcaraan?
Untuk mencipta jenis data baru.
Untuk menyimpan data dalam pembolehubah.
Tujuan ulangan 'for' dalam pengaturcaraan adalah untuk mengulangi urutan atau melaksanakan sekumpulan kod sejumlah kali tertentu.
Untuk mentakrifkan fungsi dalam pengaturcaraan.
2.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Tulis satu ulangan 'for' yang mencetak nombor 1 hingga 5.
for (i = 1; i <= 5; i++) { console.log(i); }
for ( i = 0; i < 5; i++) { console.log(i)
for ( i = 1; i <= 10; i++) { console.log(i); }
for (i = 1; i < 5; i++) { console.log(i); }
3.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Jelaskan bagaimana ulangan 'while' berfungsi dalam pengaturcaraan.
'While' digunakan untuk mendefinisikan fungsi dalam pengaturcaraan.
'While' melaksanakan kod hanya sekali jika syaratnya benar.
'While' menjalankan sekumpulan kod dalam urutan rawak tanpa mengira syarat.
'While' berfungsi dengan melaksanakan sekumpulan kod berulang kali selagi syarat yang ditetapkan adalah benar.
4.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Buat satu ulangan 'while' yang menghitung dari 10 hingga 1.
do { console.log(count); count--; } while (count >= 1);
while (count >= 1) { console.log(count); count--; }
for (let i = 10; i > 0; i++) { console.log(i); }
while (count <= 10) { console.log(count); count++; }
5.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Apakah itu pernyataan if bersarang? Berikan contoh.
if (y > 5) { if (x == 10) { console.log('y lebih besar daripada 5 dan x sama dengan 10'); } }
if (x < 10) { console.log('x kurang daripada 10'); }
Contoh: if (x > 10) { if (y < 5) { console.log('x lebih besar daripada 10 dan y kurang daripada 5'); } }
if (x == 10) { console.log('x sama dengan 10'); }
6.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Tulis program yang menggunakan pernyataan if bersarang untuk memeriksa sama ada nombor itu positif atau negatif.
jika nombor >= 0: cetak('Negatif')
jika nombor < 0: cetak('Positif')
jika nombor > 0: cetak('Positif') elif nombor < 0: cetak('Negatif') sebaliknya: cetak('Sifar')
jika nombor == 0: cetak('Negatif')
7.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Bagaimana perbezaan antara gelung 'for' dan gelung 'while'?
Gelung 'for' hanya boleh mengulangi array, manakala gelung 'while' boleh mengulangi sebarang jenis data.
Gelung 'for' memerlukan syarat untuk dijalankan, manakala gelung 'while' tidak.
Gelung 'for' sentiasa lebih pantas daripada gelung 'while' tanpa mengira situasi.
Gelung 'for' digunakan untuk bilangan pengulangan yang diketahui, manakala gelung 'while' digunakan untuk bilangan pengulangan yang tidak diketahui berdasarkan syarat.
Create a free account and access millions of resources
Create resources
Host any resource
Get auto-graded reports

Continue with Google

Continue with Email

Continue with Classlink

Continue with Clever
or continue with

Microsoft
%20(1).png)
Apple

Others
By signing up, you agree to our Terms of Service & Privacy Policy
Already have an account?
Similar Resources on Wayground
15 questions
ความปลอดภัยทางอินเทอร์เน็ต
Quiz
•
KG - 2nd Grade
25 questions
Cyber Latest Developments (Can Practice NCO in it))
Quiz
•
1st - 5th Grade
20 questions
computer revison questions
Quiz
•
1st - 8th Grade
15 questions
Philosophical Chairs
Quiz
•
KG - University
20 questions
P.2 Midterm 1
Quiz
•
2nd Grade
16 questions
Quizz
Quiz
•
1st - 12th Grade
15 questions
Digital Devices
Quiz
•
1st - 12th Grade
15 questions
Implementasi VLAN
Quiz
•
2nd Grade
Popular Resources on Wayground
20 questions
Brand Labels
Quiz
•
5th - 12th Grade
10 questions
Ice Breaker Trivia: Food from Around the World
Quiz
•
3rd - 12th Grade
25 questions
Multiplication Facts
Quiz
•
5th Grade
20 questions
ELA Advisory Review
Quiz
•
7th Grade
15 questions
Subtracting Integers
Quiz
•
7th Grade
22 questions
Adding Integers
Quiz
•
6th Grade
10 questions
Multiplication and Division Unknowns
Quiz
•
3rd Grade
10 questions
Exploring Digital Citizenship Essentials
Interactive video
•
6th - 10th Grade
Discover more resources for Computers
10 questions
Verbs
Quiz
•
2nd Grade
11 questions
NFL Football logos
Quiz
•
KG - Professional Dev...
20 questions
addition
Quiz
•
1st - 3rd Grade
20 questions
Subject and predicate in sentences
Quiz
•
1st - 3rd Grade
20 questions
Place Value
Quiz
•
KG - 3rd Grade
10 questions
Exploring Force and Motion Concepts
Interactive video
•
1st - 5th Grade
30 questions
Multiplication Facts 1-12
Quiz
•
2nd - 5th Grade
10 questions
Exploring Properties of Matter
Interactive video
•
1st - 5th Grade