wayground logo

Free Printable Worksheets

NEW

Font size

S
M
L
XL
Worksheets

ASK FORM 2

Total questions: 56

Worksheet time: 28mins

Name
Class
Date
1.

Which of the following is another name for the octal number system?

a)

Binary

b)

Octal

c)

Decimal

d)

Hexadecimal

2.

Which of the following is a hexadecimal number?

a)

92H base 16

b)

81K4 base 16

c)

L25 base 16

d)

BE4 base 16

3.

Refer to the ASCII code table showing the mappings for H to M: for each character, the table lists decimal, binary, octal, and hexadecimal values. For example, H is shown as decimal 72, binary 01001000, octal 110, and hexadecimal 48; I is 73, 01001001, 111, 49; J is 74, 01001010, 112, 4A; K is 75, 01001011, 113, 4B; L is 76, 01001100, 114, 4C; M is 77, 01001101, 115, 4D. What hexadecimal number is represented by the ASCII code for the letter K?

a)

75

b)

4B

c)

113

d)

01001011

4.

The flowchart shows a loop that: starts, prompts to input y, sets y to the entered number, checks the decision "y bukan abjad?" (y is not a letter?). If Yes, it loops back to input; if No, it ends. What loop control structure is involved?

a)

if

b)

for

c)

while

d)

repeat-until

5.

The following are steps for finding errors in a program, but they are not in order. I Re-run the program II Fix the error III Perform a desk check IV Compare the program’s results with the algorithm Arrange these steps in the correct order.

a)

I, II, III, IV

b)

II, III, IV, I

c)

III, IV, I, II

d)

IV, III, II, I

6.

The table explains the difference between a variable and a constant. Under Constant it says "Has a fixed value and does not change" and under Variable it shows X. What is X?

a)

Has a value that can change

b)

Has a value defined by a formula

c)

Has a value that can be computed

d)

Has a positive value

7.

The following code segments for computing the volume of a cone are not in order. Choose the correct order. I jejari = int(input("Masukkan jejari:")) tinggi = int(input("Masukkan tinggi:")) II print("Isipadu kon ialah", round(isipadu, 2)) III pi = 3.142 IV isipadu = 1 / 3 * pi * jejari**2 * tinggi

a)

II, I, III, IV

b)

II, III, I, IV

c)

III, I, IV, II

d)

IV, III, II, I

8.

What type of error occurs in the following code segment? a = int(12) b = int(0) c = a / b print(c)

a)

Runtime error

b)

Syntax error

c)

Logic error

d)

Carelessness error

9.

The flowchart shows two decisions in sequence: First, "Syarat 1 dipenuhi?" (Condition 1 met?). If Yes, it checks "Syarat 2 dipenuhi?". If the second answer is No, "Pernyataan 1" executes; if Yes, "Pernyataan 2" executes. What is the control structure?

a)

Sequence control structure

b)

Selection control structure

c)

Iteration control structure

d)

Nested selection control structure

10.

The following are steps for testing and debugging a program, but they are not in order. P Develop the program code Q Actual output obtained R Fix the program code S Error message displayed Arrange these steps in the correct order.

a)

P, Q, R, S

b)

Q, P, S, R

c)

P, S, R, Q

d)

Q, S, R, P

11.

Berikut menunjukkan jadual penukaran nombor perlapangan kepada nombor perpuluhan untuk 3614 dalam asas 8. Nilai tempat digit perlapangan bagi 838^3 ialah berapa?

a)

838^3 = 512

b)

838^3 = 256

c)

838^3 = 128

d)

838^3 = 1024

12.

Merujuk jadual penukaran bagi 3614 dalam asas 8, digit bagi lajur 8^2 ialah berapa?

a)

6

b)

3

c)

1

d)

4

13.

Merujuk jadual penukaran bagi 3614 dalam asas 8, hasil darab untuk lajur 838^3 ialah berapa?

a)

1536

b)

512

c)

384

d)

1920

14.

Berdasarkan jadual penukaran bagi 3614 dalam asas 8, jumlah ‘Hasil tambah’ dalam perpuluhan ialah berapa?

a)

1932

b)

1928

c)

1940

d)

1832

15.

Nyatakan sama ada kenyataan ini BENAR atau PALSU: Bahasa Mesin dikenali sebagai kod mesin yang terdiri daripada urutan digit 0 dan 1, iaitu nombor perduaan.

a)

Benar

b)

Palsu

16.

Nyatakan sama ada kenyataan ini BENAR atau PALSU: ASC11 ialah singkatan bagi American Standard Code for Internet Information.

a)

Benar

b)

Palsu

17.

Nyatakan sama ada kenyataan ini BENAR atau PALSU: Bahagi dengan 8 dan gunakan bakinya.

a)

Benar

b)

Palsu

18.

Nyatakan sama ada kenyataan ini BENAR atau PALSU: Mendarab digit dalam nombor perlapangan dengan nilai tempat nombor perlapangan.

a)

Benar

b)

Palsu

19.

Nyatakan sama ada kenyataan ini BENAR atau PALSU: Bahagi dengan 16 dan gunakan bakinya.

a)

Benar

b)

Palsu

20.

Nyatakan sama ada kenyataan ini BENAR atau PALSU: Pengumpulan tiga digit nombor perduaan dan tukarkan kepada nilai penilaian.

a)

Benar

b)

Palsu

21.

Isikan tempat kosong: Manusia menggunakan sistem nombor …

a)

perpuluhan

b)

perduaan

c)

ASCII

d)

Code for Information Interchange

22.

Isikan tempat kosong: Komputer menggunakan sistem nombor …

a)

perduaan

b)

perpuluhan

c)

ASCII

d)

Code for Information Interchange

23.

Isikan tempat kosong: Kod yang mewakili setiap aksara pada papan kekunci dikenali sebagai …

a)

ASCII

b)

perduaan

c)

perpuluhan

d)

Code for Information Interchange

24.

Isikan tempat kosong: Kod … adalah singkatan kepada American Standard …

a)

ASCII; Code for Information Interchange

b)

ASCII; Computer Information Index

c)

perduaan; Code for Internet Information

d)

perpuluhan; Character Input Interface

25.

Rajah 1 menunjukkan atur cara mengira luas dan perimeter sebuah padang bola. Pilih pembetulan ralat logik yang betul bagi pengiraan perimeter.

a)

perimeter = 2*(panjang + lebar)

b)

perimeter = panjang * lebar

c)

perimeter = panjang + lebar

d)

perimeter = 2*panjang*lebar

26.

Merujuk Rajah 1, apakah pembetulan yang betul untuk baris output perimeter?

a)

Cetak pemboleh ubah perimeter: print("\n \n Perimeter padang bola ialah ", perimeter)

b)

Cetak pemboleh ubah luas: print("\n \n Perimeter padang bola ialah ", luas)

c)

Buang baris cetakan perimeter sepenuhnya

d)

Tukar mesej kepada ‘Luas padang bola’ tanpa nilai

27.

Pilih jenis ralat yang betul: Kesilapan dalam penggunaan bahasa pengaturcaraan.

a)

Ralat sintaks

b)

Ralat logik

c)

Ralat masa larian

28.

Pilih jenis ralat yang betul: Kesilapan semasa pembinaan algoritma dan ralat sukar dikesan kerana tiada paparan mesej ralat.

a)

Ralat logik

b)

Ralat sintaks

c)

Ralat masa larian

29.

Pilih jenis ralat yang betul: Kesilapan yang menyebabkan atur cara terhenti secara tiba-tiba tanpa diduga semasa ujian dijalankan.

a)

Ralat masa larian

b)

Ralat logik

c)

Ralat sintaks

30.

Tentukan sama ada padanan ini betul atau salah: print = float(input("Masukkan nama anda")) dipadankan dengan Ralat sintaks.

a)

Betul

b)

Salah

31.

Tentukan sama ada padanan ini betul atau salah: x = a / 0 dipadankan dengan Ralat masa larian.

a)

Betul

b)

Salah

32.

Tentukan sama ada padanan ini betul atau salah: bmi = berat*tinggi dipadankan dengan Ralat logik.

a)

Betul

b)

Salah

33.

Tentukan sama ada padanan ini betul atau salah: c = str(a) + int(b) dipadankan dengan Ralat sintaks.

a)

Betul

b)

Salah

34.

Lengkapkan atur cara yang menerima input nama, umur, serta mengira BMI berdasarkan tinggi dan berat. Pilih nilai yang betul untuk A dalam baris: nama = ……A…… (input("Masukkan nama anda: ")).

a)

str

b)

float

c)

int

d)

bmi

35.

Lengkapkan atur cara. Pilih nilai yang betul untuk B dalam baris: berat = ………B…… (input("Masukkan berat anda dalam kg:"))

a)

float

b)

int

c)

str

d)

bmi

36.

Lengkapkan atur cara. Pilih nama pemboleh ubah yang betul untuk C dalam baris: ……C…. = berat / (tinggi*tinggi)

a)

bmi

b)

nama

c)

umur

d)

berat

37.

Lengkapkan atur cara. Pilih nilai yang betul untuk D dalam baris: print("Nama anda ialah", ……D……)

a)

nama

b)

bmi

c)

umur

d)

tinggi

38.

The following box shows the exact output of a code segment: Output Berat pelajar 1:60 Berat pelajar 2 : 55 Purata berat pelajar dalam kg ialah:57.5 Based on this output, which code segment would correctly produce it?

a)

print("Output")\nprint("Berat pelajar 1:60")\nprint("Berat pelajar 2 : 55")\nw1 = 60\nw2 = 55\npurata = (w1 + w2) / 2\nprint("Purata berat pelajar dalam kg ialah:" + str(purata))

b)

w1 = 60\nw2 = 55\nprint("Output")\nprint("Berat pelajar 1 :", w1)\nprint("Berat pelajar 2 :", w2)\nprint("Purata berat pelajar dalam kg ialah:", (w1 + w2) / 2)

c)

print("Output")\nw1 = input("Berat pelajar 1:")\nw2 = input("Berat pelajar 2 : ")\nprint("Purata berat pelajar dalam kg ialah:" + (w1 + w2) / 2)

d)

print("Output")\nw1 = 60\nw2 = 55\npurata = (w1 + w2) // 2\nprint("Berat pelajar 1:60")\nprint("Berat pelajar 2 : 55")\nprint("Purata berat pelajar dalam kg ialah:" + str(purata))

39.

A program displays quiz eligibility for a school prefect selection. It begins with this line: print("Atur cara memaparkan keputusan kuiz kelayakan pengawas.") The partially completed code uses placeholders P, Q, R, and S: markah = 1 while markah != 0: markah = Q(input("Masukkan satu nombor integer : ")) if markah == 0: R elif markah > 49: print("Tahniah, anda layak") S print("Maaf, anda tidak layak") Which statement should replace P to match the program’s on-screen guidance shown in the output box that says to enter 0 to stop?

a)

print('Masukkan nombor SIFAR "0" jika ingin berhenti')

b)

input('Masukkan nombor SIFAR "0" jika ingin berhenti')

c)

markah = 0

d)

print('Masukkan nombor SATU "1" jika ingin berhenti')

40.

In the same partially completed program for displaying quiz eligibility (see code skeleton in the previous question), which built-in should replace Q so numerical input is read correctly for comparisons?

a)

int

b)

float

c)

str

d)

bool

41.

In the same program, when the user enters 0, the program should thank the user before stopping. Which statement should replace R?

a)

print("Terima kasih")

b)

print("Maaf, anda tidak layak")

c)

print("Tahniah, anda layak")

d)

break

42.

In the same program, after checking 'elif markah > 49', the code should ensure that the message 'Maaf, anda tidak layak' is printed for all other nonzero scores. Which keyword should replace S?

a)

else:

b)

if markah < 50:

c)

elif markah <= 49:

d)

continue

43.

The following code segment is intended to find the average body weight of two pupils but contains errors (three circled regions in the image): m1 = float (input ("Masukkan berat (kg) murid 1 :") ) m2 = float ( ("Masukkan berat (kg) murid 1 :") ) purata = m + m / 2 print("Berat badan (kg)") print("Purata berat badan : ", round (purata, 1),"kg") Which correction best fixes the second assignment so the second pupil’s weight is read properly?

a)

m2 = float(input("Masukkan berat (kg) murid 2 :"))

b)

m2 = input(float("Masukkan berat (kg) murid 2 :"))

c)

m2 = int(input("Masukkan berat (kg) murid 1 :"))

d)

m2 = float("Masukkan berat (kg) murid 2 :")

44.

In the same code, which replacement correctly computes the average of the two weights? The faulty line is 'purata = m + m / 2'.

a)

purata = (m1 + m2) / 2

b)

purata = m1 + m2 / 2

c)

purata = (m1 * m2) / 2

d)

purata = m1 / m2

45.

In the same code, the final output should clearly display the rounded average with units. Which corrected print statement best meets this requirement?

a)

print("Purata berat badan (kg):", round(purata, 1))

b)

print("Purata berat badan:", purata, "kg", 1)

c)

print("Purata berat badan (kg)" + round(purata, 1))

d)

print(round(purata, 1))

46.

The following table lists equivalent numbers used in data representation: Decimal number 8976108976_{10} ; Hexadecimal number 2310162310_{16} ; Binary number 001000110001000020010001100010000_{2} . State one use of the hexadecimal number system.

a)

Encoding colors in web design such as #FF00AA

b)

Measuring temperature on the Celsius scale

c)

Writing paragraphs in natural language

d)

Mixing audio waveforms in a DAW

47.

Using the divide-by-16 method and remainders, determine the hexadecimal representation that is equivalent to the decimal number 8976108976_{10} .

a)

2310162310_{16}

b)

2390162390_{16}

c)

23A01623A0_{16}

d)

2210162210_{16}

48.

Using four-bit grouping, determine the binary representation that is equivalent to the hexadecimal number 2310162310_{16} .

a)

001000110001000020010001100010000_{2}

b)

001000110000100020010001100001000_{2}

c)

000100110001000020001001100010000_{2}

d)

001000111001000020010001110010000_{2}

49.

The following program displays a comparison of a number entered by the user: nom=int(input("Masukkan nombor 1-9 : ")) if nom>0 and nom<5: print("Nombor adalah lebih kecil daripada 5.") elif nom ==5: print("Nombor adalah 5.") elif nom > 5 and nom <10: print("Nombor adalah lebih besar daripada 5.") else: print("Nombor bukan dalam lingkungan 1-9.") Identify the control structure used in this program.

a)

Selection using if–elif–else

b)

Definite iteration using for-loop

c)

Recursion with a function call

d)

Sequential execution without branches

50.

Based on the program shown, what output is printed when the input is 66 ?

a)

Number is greater than 5.

b)

Number is less than 5.

c)

Number is 5.

d)

Number is not in the range 1-9.

51.

Based on the program shown, what output is printed when the input is 00 ?

a)

Number is not in the range 1-9.

b)

Number is less than 5.

c)

Number is greater than 5.

d)

Number is 5.

52.

Based on the program shown, what output is printed when the input is 1111 ?

a)

Number is not in the range 1-9.

b)

Number is less than 5.

c)

Number is greater than 5.

d)

Number is 5.

53.

Based on the program shown, what output is printed when the input is 22 ?

a)

Number is less than 5.

b)

Number is greater than 5.

c)

Number is 5.

d)

Number is not in the range 1-9.

54.

A formula is provided for the surface area of a sphere: Surface area =4πj=4\pi j where π=3.142\pi=3.142 and jj is the radius. Based on this formula, which assignment correctly sets the value of the constant for π\pi in code?

a)

pi = 3.142

b)

pi = 22/7 exactly

c)

pi = 3.0

d)

pi = "3.142" (a string)

55.

Using the same sphere formula and constants given, which code line best computes the variable luas_sfera (surface area) from the radius variable jejari?

a)

luas_sfera = 4*pi*jejari*jejari

b)

luas_sfera = 2*pi*jejari

c)

luas_sfera = pi*jejari*jejari

d)

luas_sfera = (4/3)*pi*jejari*jejari*jejari

56.

Which print statement correctly displays the computed surface area stored in luas_sfera?

a)

print("Surface area is", luas_sfera)

b)

print("Surface area is" + luas_sfera)

c)

print(luas_sfera, "is the surface area", jejari)

d)

print("Surface area:")