wayground logo

Free Printable Worksheets

NEW

Font size

S
M
L
XL
Worksheets

Binding

Total questions: 11

Worksheet time: 4mins

Name
Class
Date
1.

ข้อใดไม่สามารถใช้ตั้งชื่อตัวแปรในภาษา Python ได้

a)

last_updated

b)

_temp

c)

ผลบวก

d)

continue

2.

ข้อใดเป็นการตัวชื่อแบบ Camel Case

a)

last_name

b)

lastName

c)

last-name

d)

LastName

3.

ข้อใดเป็นชื่อตัวแปร/ชื่อฟังก์ชันใน Python ที่ถูกต้องตาม PEP 8 – Style Guide for Python Code

a)

reverse_name
(Snake case)

b)

ReverseName

(Pascal case)

c)

reverseName

(Camel case)

d)

reverse-name

(Kebab case)

4.

ข้อใดจับคู่ Binding time ไม่ถูกต้อง

a)

* คือ operator ในการคูณ : Language design time

b)

ชนิดข้อมูลของตัวแปรใน Java : Compile time

c)

ค่าของตัวแปร local ในฟังก์ชันภาษา C: Link time

d)

float ใช้พื้นที่ 4 ไบต์: Language implementation time

5.

ข้อใดเป็น dynamic binding ในภาษา C (เกิดขึ้น ณ ตอน runtime)

a)

int x;

b)

x = 6;

c)

static int x = 5;

d)

int x จองพื้นที่ในหน่วยความจำ 4 ไบต์

6.

ข้อใดกล่าวถูกต้อง

a)

ภาษา Java เป็น Dynamic type binding

b)

ภาษา Python เป็น Static type binding

c)

ภาษา Java ประกาศตัวแปรแบบ explicit declaration

d)

ภาษา C ประกาศตัวแปรแบบ implicit declaration

7.

ข้อใดพื้นที่ในหน่วยความจำสำหรับจัดเก็บ (storage allocation)

a)

static, frame, type

b)

stack, static, heap

c)

local, global

d)

explicit storage, implicit storage

8.

ตัวแปรประเภทใดที่จัดในพื้นที่ stack

a)

local variable

b)

global variable

c)

static local variable

d)

constant

9.

ข้อใดกล่าวถูกต้องเกี่ยวกับพื้นที่จัดเก็บ (storage binding)

a)

static เป็นการจองพื้นที่ไว้ชั่วคราว สำหรับตัวแปร local

b)

stack เป็นการจองพื้นที่ไว้ชั่วคราว สำหรับตัวแปร global

c)

heap เหมาะสำหรับจัดเก็บข้อมูลที่เพิ่มลดขนาดได้

d)

stack และ heap มีลักษณะการจัดเก็บแบบ LIFO เหมือนกัน

10.

ข้อใดกล่าวถูกต้องเกี่ยวกับ strong typing และ type checking

a)

ช่วยตรวจสอบการอ้างถึงตัวแปรนอกขอบเขต

b)

ดักจับคำสั่งที่จะเกิด type error เมื่อรันโปรแกรม

c)

ช่วยตรวจสอบขนาดของพื้นที่จัดเก็บข้อมูล

11.

คำสั่งใดเป็นการกำหนดค่าคงที่ในภาษา C

a)

const double PI = 3.14

b)

final double PI = 3.14

c)

constant double PI = 3.14

d)

finally double PI = 3.14