

Asas Sains Komputer Tingkatan 3
Presentation
•
Computers
•
4th - 5th Grade
•
Practice Problem
•
Hard
CHEGU AINUN NAJWA AZIZ
Used 5+ times
FREE Resource
5 Slides • 2 Questions
1
Perbezaan Pemboleh Ubah Sejagat & Setempat
Pemboleh ubah dan pemalar mungkin wujud dan akan digunakan untuk keseluruhan atur cara atau hanya bgai satu fungsi.Pembolehubah dan pemalar bagi pengaturcara terdiri daripada 2 skop iaitu :

2
Pemboleh ubah Sejagat (Global)
Hanya berfungsi dalam atur cara sahaja
Penggunaannya hanya lah SEMASA dalam fungsi atur cara sahaja. Apabila tatacara itu telah tamat, ruang memori yang diperuntukkan kepada pemboleh ubah & pemalar juga akan tamat.
3
Pemboleh ubah Setempat
Hanya berfungsi dalam subatur cara yang diisytiharkan.
Digunakan dalam fungsi 'di mana' pemboleh ubah diisytiharkan, bermula 'dari mana' pemboleh ubah diisytiharkan dan bila penamat akhir tatacara tersebut.
4
5
Contoh aturcara yang menggunakan p/ubah sejagat dan setempat
public class A {
int data = 50 ;
static int m = 100 ; ---------> pemboleh ubah sejagat
public static void main ( String [] args) { ;
int n= 90 ; ------------> pemboleh ubah setempat
}
} //end of class
6
Multiple Select
Berdasarkan atur cara di bawah, nyatakan jenis pemboleh ubah tersebut.
public class info {
static int k= 5; -----> pemboleh ubah ________
public static void main ( string[] arg) {
int m = 7; ---------> pemboleh ubah __________
sejagat
semua
setempat
kekal
7
Multiple Choice
Kenalpasti jenis pemboleh ubah dalam aturcara di bawah.
public class A {
static int nombor = 10 ;
double data = 50; ------------->p/ubah ??????
public static void main (String[] args) {
int n = 90;
int t = 190;
}
}
setempat
sejagat
nominal
biasa
Perbezaan Pemboleh Ubah Sejagat & Setempat
Pemboleh ubah dan pemalar mungkin wujud dan akan digunakan untuk keseluruhan atur cara atau hanya bgai satu fungsi.Pembolehubah dan pemalar bagi pengaturcara terdiri daripada 2 skop iaitu :

Show answer
Auto Play
Slide 1 / 7
SLIDE
Similar Resources on Wayground
8 questions
Kelas 4 Penjumlahan dan Pengurangan Berbagai Bentuk Pecahan
Presentation
•
4th Grade
10 questions
MATERI AJAR MATEMATIKA PECAHAN KELAS 5
Presentation
•
5th Grade
10 questions
perniagaan t4
Presentation
•
4th Grade
6 questions
Electricity
Presentation
•
3rd Grade
10 questions
Cuaca
Presentation
•
3rd - 4th Grade
7 questions
Magnetism/Force & Motion Study Guide
Presentation
•
4th Grade
10 questions
ELECTRIC CHARGES MOVE
Presentation
•
3rd Grade
4 questions
KETANGKASAN
Presentation
•
4th Grade
Popular Resources on Wayground
5 questions
A Home on the Shore
Quiz
•
3rd Grade
28 questions
US History Regents Review
Quiz
•
11th Grade
6 questions
A Horse Tale
Quiz
•
3rd Grade
20 questions
Math Review
Quiz
•
3rd Grade
10 questions
Juneteenth History and Significance
Interactive video
•
5th - 8th Grade
20 questions
Dividing Fractions
Quiz
•
5th Grade
55 questions
A Long Walk to Water Final Review
Quiz
•
6th - 8th Grade
10 questions
Equation Word Problems
Quiz
•
7th Grade
Discover more resources for Computers
10 questions
Juneteenth History and Significance
Interactive video
•
5th - 8th Grade
20 questions
Dividing Fractions
Quiz
•
5th Grade
20 questions
Figurative Language Review
Quiz
•
4th Grade
25 questions
Branches of the United States Government
Quiz
•
4th Grade
20 questions
Math Review
Quiz
•
5th Grade
17 questions
Multiply and Divide Fractions
Quiz
•
5th Grade
40 questions
Flags of the World
Quiz
•
KG - Professional Dev...
30 questions
Multiplication Facts 1-12
Quiz
•
2nd - 5th Grade